Skip to content

Commit

Permalink
dm/002: add --retry option to dmsetup remove command
Browse files Browse the repository at this point in the history
The test case dm/002 rarely fails with the message below:

dm/002 => nvme0n1 (dm-dust general functionality test)       [failed]
    runtime  0.204s  ...  0.174s
    --- tests/dm/002.out        2024-06-14 14:37:40.480794693 +0900
    +++ /home/shin/Blktests/blktests/results/nvme0n1/dm/002.out.bad     2024-06-14 21:38:18.588976499 +0900
    @@ -7,4 +7,6 @@
     countbadblocks: 0 badblock(s) found
     countbadblocks: 3 badblock(s) found
     countbadblocks: 0 badblock(s) found
    +device-mapper: remove ioctl on dust1  failed: Device or resource busy
    +Command failed.
     Test complete
modprobe: FATAL: Module dm_dust is in use.

When udev opens the dm device, "dmsetup remove" command also tries to
open the device and fails with EBUSY. To avoid the failure, add the
--retry option to the dmsetup command.

Suggested-by: Milan Broz <gmazyland@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: Nitesh Shetty <nj.shetty@samsung.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
  • Loading branch information
kawasaki committed Jul 29, 2024
1 parent a24a7b4 commit 25efe2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/dm/002
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ test_device() {
sync
dmsetup message dust1 0 countbadblocks
sync
dmsetup remove dust1
dmsetup remove --retry dust1 |& grep -v "Device or resource busy"

echo "Test complete"
}

0 comments on commit 25efe2a

Please sign in to comment.