[PATCH blktests] nvme/068: add a test for multipath delayed removal

John Garry john.g.garry at oracle.com
Mon Apr 27 05:51:17 PDT 2026


On 27/04/2026 13:17, Daniel Wagner wrote:
> On Wed, Apr 15, 2026 at 10:41:11AM +0000, John Garry wrote:
>> +	# Part a: Prove that writes fail when no path returns. Any reads or
>> +	#	  writes are queued during the delayed removal period. If no
>> +	#	  paths return before the timer expires, then those IOs should
>> +	#	  fail.
>> +	#	  During the delayed removal period, ensure that the module
>> +	#	  refcnt is incremented, to prove that we cannot remove the
>> +	#	  driver during this period.
>> +	nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
>> +	ns=$(_find_nvme_ns "${def_subsys_uuid}")
>> +	refcnt=$(_module_use_count nvme_core)
>> +	echo 10 > "/sys/block/"$ns"/delayed_removal_secs"
>> +	refcnt_orig=$(_module_use_count nvme_core)
>> +	_nvme_disconnect_ctrl "${nvmedev}"
>> +	sleep 1
> Is there a better alternative to sleep for these tests? I'm worried
> about reliability and the extra runtime added by idling.

I suppose that I could check sysfs to ensure that the controller has 
disappeared (instead of the sleep) for the disconnect. And similar idea 
for reconnect.

However some of what we want to test is still based on timing - for 
example, if we set delayed removal timeout to X seconds, we want to 
ensure that the gendisk is gone after X seconds. So we need the X second 
delay. Currently X is 10, but can shorten that.

sound ok?






More information about the Linux-nvme mailing list