Skip devices held open after their last session in vitastor-nbd map #172

Open
koolkhel wants to merge 2 commits from koolkhel/vitastor:nbd-map-held-device into master

2 Commits

Author SHA1 Message Date
542ed24037 test_nbd_map_held_device: Use check_nbd, log vitastor-nbd, hold the device up to 3 minutes 2026-11-24 11:41:17 +03:00
4d75f22e24 Skip devices held open after their last session in vitastor-nbd map
A device that another process (udev, a writer, a mount) still holds
open after its vitastor-nbd exited keeps the old kernel session.
NBD_SET_SOCK accepts the new socket, but NBD_DO_IT then fails with EBUSY
because the old session's pid is still set. map had already reported
success and printed the device, which returned EIO.

After NBD_SET_SOCK, treat an existing /sys/block/nbdN/pid as busy, so
map tries the next device, or fails for an explicitly named one.
2026-11-24 08:22:47 +03:00