[PATCH 07/13] libmultipath: Add delayed removal support

John Garry john.g.garry at oracle.com
Fri Apr 10 04:49:15 PDT 2026


On 10/04/2026 11:51, Nilay Shroff wrote:
>> About the module refcounting, as I mentioned earlier it's hard to test 
>> this effectively. We could use lsmod to check refcount on nvme ko 
>> during the delayed removal window and ensure that it was incremented. 
>> I'm not sure if it is robust and whether the complexity is worth it.
>>
> Regarding module refcnt, I think that's easily available
> if we read /sys/module/<mod-name>/refcnt. We may not
> need to parse lsmod output.

Sure, so we would be testing this behaviour:

# echo 40 > 
/sys/class/nvme-subsystem/nvme-subsys1/nvme1n1/delayed_removal_secs
# cat /sys/module/nvme_core/refcnt
3
# nvme disconnect -n nvme-test-target
[  562.533253] nvme nvme1: Removing ctrl: NQN "nvme-test-target"
[  562.565462] nvme nvme2: Removing ctrl: NQN "nvme-test-target"
NQN:nvme-test-target disconnected 2 controller(s)
# cat /sys/module/nvme_core/refcnt
4
# sleep 40
# cat /sys/module/nvme_core/refcnt
3
#

File /sys/module/nvme_core/refcnt would not exist for when it's builtin, 
but I don't think that blktests even support builtin modules.

Cheers



More information about the Linux-nvme mailing list