From 65e38f267c0e2e6b115178f5dc3a3de62abcb67a Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski Date: Thu, 31 Oct 2024 14:33:01 -0400 Subject: [PATCH] libmultipath: remove devices with no table and multipath DM UUID if dm_get_multipath() returns DMP_BAD_DEV in dm_get_maps(), it means that it found an device with a DM UUID prefix of "mpath-" but no table. Treat this as the remains of a failed device creation, and remove it like dm_addmap_create() does when it fails to fully create a device and it's left in this state. Signed-off-by: Benjamin Marzinski --- libmultipath/devmapper.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c index 0d1552f5..908d759c 100644 --- a/libmultipath/devmapper.c +++ b/libmultipath/devmapper.c @@ -1283,6 +1283,10 @@ int dm_get_maps(vector mp) vector_set_slot(mp, mpp); break; case DMP_BAD_DEV: + condlog(2, "%s: removing empty multipath device", + names->name); + dm_device_remove(names->name, 0); + break; case DMP_NO_MATCH: case DMP_NOT_FOUND: break;