* [PATCH] btrfs-progs: tests/mkfs/005: use udevadm settle to avoid false alerts
@ 2023-08-08 5:52 Qu Wenruo
2023-08-09 13:17 ` Josef Bacik
0 siblings, 1 reply; 2+ messages in thread
From: Qu Wenruo @ 2023-08-08 5:52 UTC (permalink / raw)
To: linux-btrfs
[BUG]
During my test runs of mkfs-tests, 005-long-device-name-for-ssd failed
with the following error messages:
====== RUN CHECK dmsetup remove btrfs-test-with-very-long-name-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQPGc
device-mapper: remove ioctl on btrfs-test-with-very-long-name-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQPGc failed: Device or resource busy
Command failed.
failed: dmsetup remove btrfs-test-with-very-long-name-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQPGc
test failed for case 005-long-device-name-for-ssd
[CAUSE]
There seems to be a race between "btrfs inspect dump-super" and the
dmsetup removal.
[FIX]
Add a "udevadm settle" before removing the dm devices.
Also since we're here, use the same "udevadm settle" instead of the
manual sleep to wait for the new dm device to showup.
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
tests/mkfs-tests/005-long-device-name-for-ssd/test.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/mkfs-tests/005-long-device-name-for-ssd/test.sh b/tests/mkfs-tests/005-long-device-name-for-ssd/test.sh
index 208698dce243..c32eb3a42def 100755
--- a/tests/mkfs-tests/005-long-device-name-for-ssd/test.sh
+++ b/tests/mkfs-tests/005-long-device-name-for-ssd/test.sh
@@ -24,7 +24,7 @@ loopdev=`run_check_stdout $SUDO_HELPER losetup --find --show img`
run_check $SUDO_HELPER dmsetup create "$dmname" --table "0 1048576 linear $loopdev 0"
# Setting up the device may need some time to appear
-sleep 5
+run_check $SUDO_HELPER udevadm settle
if ! [ -b "$dmdev" ]; then
_not_run "dm device created but not visible in /dev/mapper"
fi
@@ -43,6 +43,8 @@ run_check_stdout $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$@" "$dmdev" |
grep -q 'SSD detected:.*yes' || _fail 'SSD not detected'
run_check $SUDO_HELPER "$TOP/btrfs" inspect-internal dump-super "$dmdev"
+run_check $SUDO_HELPER udevadm settle
+
# cleanup
run_check $SUDO_HELPER dmsetup remove "$dmname"
run_mayfail $SUDO_HELPER losetup -d "$loopdev"
--
2.41.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] btrfs-progs: tests/mkfs/005: use udevadm settle to avoid false alerts
2023-08-08 5:52 [PATCH] btrfs-progs: tests/mkfs/005: use udevadm settle to avoid false alerts Qu Wenruo
@ 2023-08-09 13:17 ` Josef Bacik
0 siblings, 0 replies; 2+ messages in thread
From: Josef Bacik @ 2023-08-09 13:17 UTC (permalink / raw)
To: Qu Wenruo; +Cc: linux-btrfs
On Tue, Aug 08, 2023 at 01:52:06PM +0800, Qu Wenruo wrote:
> [BUG]
> During my test runs of mkfs-tests, 005-long-device-name-for-ssd failed
> with the following error messages:
>
> ====== RUN CHECK dmsetup remove btrfs-test-with-very-long-name-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQPGc
> device-mapper: remove ioctl on btrfs-test-with-very-long-name-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQPGc failed: Device or resource busy
> Command failed.
> failed: dmsetup remove btrfs-test-with-very-long-name-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQPGc
> test failed for case 005-long-device-name-for-ssd
>
> [CAUSE]
> There seems to be a race between "btrfs inspect dump-super" and the
> dmsetup removal.
>
> [FIX]
> Add a "udevadm settle" before removing the dm devices.
>
> Also since we're here, use the same "udevadm settle" instead of the
> manual sleep to wait for the new dm device to showup.
>
> Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Thanks,
Josef
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-09 13:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-08 5:52 [PATCH] btrfs-progs: tests/mkfs/005: use udevadm settle to avoid false alerts Qu Wenruo
2023-08-09 13:17 ` Josef Bacik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).