[PATCH blktests] nvme/050: repeat checking test device restoration

Chaitanya Kulkarni chaitanyak at nvidia.com
Mon Aug 18 09:10:31 PDT 2025


On 8/18/25 05:14, Shin'ichiro Kawasaki wrote:
> Since kernel version 6.17-rc1, the test case nvme/050 has been failing
> with the error message "Failed to restore ${TEST_DEV}". This failure
> happens because the device restoration check is executed too early,
> shortly after writing to /sys/bus/pci/rescan. To avoid the failure,
> implement repeated checks for the device restoration with short sleeps.
>
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki at wdc.com>
> ---
> This is the blktests side fix for the nvme/050 failure reported for v6.16-rc1
> kernel [1].
>
> [1] https://lore.kernel.org/linux-block/suhzith2uj75uiprq4m3cglvr7qwm3d7gi4tmjeohlxl6fcmv3@zu6zym6nmvun/
>
>   tests/nvme/050 | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/tests/nvme/050 b/tests/nvme/050
> index c710832..ba55c6e 100755
> --- a/tests/nvme/050
> +++ b/tests/nvme/050
> @@ -23,6 +23,7 @@ requires() {
>   test_device() {
>   	local nvme_ns
>   	local pdev
> +	local i
>   
>   	echo "Running ${TEST_NAME}"
>   
> @@ -49,7 +50,13 @@ test_device() {
>   	# Remove and rescan the NVME device to ensure that it has come back
>   	echo 1 > "/sys/bus/pci/devices/${pdev}/remove"
>   	echo 1 > /sys/bus/pci/rescan
> -	if [[ ! -b ${TEST_DEV} ]]; then
> +	for ((i = 0; i < 10; i++)); do

This looks good to me, however do we want this loop bounded by 
hard-coded value
or we create a config var that user can set on respective setup ?
either way :-


Looks good.

Reviewed-by: Chaitanya Kulkarni <kch at nvidia.com>

-ck




More information about the Linux-nvme mailing list