[PATCH 1/5] nvme-core: Make nvme_init/uninit_ctrl setup/teardown symmetric
Sagi Grimberg
sagi at grimberg.me
Wed Oct 18 08:29:40 PDT 2017
>> From: Roy Shterman <roys at lightbitslabs.com>
>>
>> Its strange to have some of the cleanup for nvme_init_ctrl in
>> nvme_free_ctrl. This cause us to have some magic ctrl refcount
>> handling in controller initialization error paths.
>>
>> Make the init/uninit symmetric so we can have a sane and
>> maintainable error sequences.
>
> It's not magic. It's just preventing name reuse when some management
> code retains an open handle after the device was removed.
management code as in nvme-cli?
> Otherwise
> you're going to get naming clashes when you bring up a new device with
> the same name from reusing the still in-use instance.
Can userspace keep an open-handle after device_destroy() was invoked?
Can you explain how would I see naming clashes? I'm not sure I
understand what you are referring to.
More information about the Linux-nvme
mailing list