Skip to contentSkip to conversation

activate: skip multipath devices with no active path that queue I/O

PATCH New Mark Syms 1 participant 1 message Nov 17

lore
Share & tools
lore

Mark Syms

author
#0 lore raw

PATCH 1/1 activate: skip multipath devices with no active path that queue I/O

Reading a multipath device that has lost every path while its table still has queue_if_no_path blocks until a path returns. When the LUN has been unmapped or removed on the array, that is never, and every command that scans devices hangs in D state on it, whichever VG it was run for. Nothing in the scan avoided such a device: dm_device_is_usable() carried a FIXME for exactly this case.

Seen in production with a NetApp LUN unmapped while still in use, under the shipped "no_path_retry queue" config: every vgs/lvs on every host that saw the LUN hung, along with everything that serialised behind them.

Treat such a device as unusable, alongside the existing check for mirrors that would block. The status gives each path's state; the table says whether the device queues. Both come from device-mapper ioctls, so the check does no I/O to the device itself. A device whose paths have all been removed is treated the same way.

---
Tested on XenServer 8, whose lvm2 is 2.02.180-based, with the same change in device_is_usable(): with every path to a NetApp FC LUN failed under no_path_retry queue, an lvs of an unrelated VG with no device restriction completed in about a second, where without the change it blocked until the map stopped queueing (17 minutes in that run). It builds cleanly on main; I have not added a test/shell case, as faking a dead queueing multipath map needs real dm-multipath paths.

 WHATS_NEW                  |  1 +
 lib/activate/activate.h    |  1 +
 lib/activate/dev_manager.c | 62 +++++++++++++++++++++++++++++++++++++-
 3 files changed, 63 insertions(+), 1 deletion(-)
WHATS_NEW +1 -0
index 095ecff..c511d05 100644
@@ -1,5 +1,6 @@
 Version 2.03.45 - 
 ==================
+  Skip multipath devices that queue I/O with no active path when scanning.
   Warn that extending a RAID LV before dm-raid 1.15.0 needs a resync.
   Refuse extending a RAID LV that is degraded or rebuilding a leg.
   Add configure --with-default-io-engine=ENGINE setting.
lib/activate/activate.h +1 -0
index ef2e1b2..0049fec 100644
@@ -280,6 +280,7 @@ void fs_unlock(void);
 #define TARGET_NAME_ERROR_OLD "erro"	/* Truncated in older kernels */
 #define TARGET_NAME_LINEAR "linear"
 #define TARGET_NAME_MIRROR "mirror"
+#define TARGET_NAME_MULTIPATH "multipath"
 #define TARGET_NAME_RAID "raid"
 #define TARGET_NAME_SNAPSHOT "snapshot"
 #define TARGET_NAME_SNAPSHOT_MERGE "snapshot-merge"
lib/activate/dev_manager.c +61 -1

86 lines not on this page · raw message

Signature · 1 line
2.56.0