Skip to contentSkip to conversation

nbd/001: wait for the device node to show up before running parted

PATCH Applied Christoph Hellwig 2 participants 2 messages Feb 29, 2024 – Mar 1, 2024 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nbd/001: wait for the device node to show up before running parted

The parted call can happen before the device is settled and thus fail. Currently this happens very rarely for me (about 1 in 500 runs), but a pending change to freeze the queues for updating the limits will make it much more likely to hit.

---
 tests/nbd/001 | 2 ++
 1 file changed, 2 insertions(+)
tests/nbd/001 +2 -0
index 9427f8e..5fd0d43 100755
@@ -18,6 +18,8 @@ test() {
 	echo "Running ${TEST_NAME}"
 	_start_nbd_server
 	nbd-client -L -N export localhost /dev/nbd0 >> "$FULL" 2>&1
+	udevadm settle
+
 	parted -s /dev/nbd0 print 2>> "$FULL" | grep 'Disk /dev/nbd0'
 	lsblk --raw --noheadings /dev/nbd0
 
Signature · 1 line
2.39.2
#1 lore raw
Quoted 6 lines · Christoph Hellwig

The parted call can happen before the device is settled and thus fail. Currently this happens very rarely for me (about 1 in 500 runs), but a pending change to freeze the queues for updating the limits will make it much more likely to hit.

Applied, thanks!