Merge from master. Check available space before attach IO objects.