I don't think this is actually enough on it's own. You'll also need to move al the teardown logic that is currently in nbd_dev_remove. And with this you should be able to remove the NULL check in nbd_open, and propably the nbd_index_mutex critical section. Although that'll need a very careful audit.