Skip to content

Commit

Permalink
libmultipath: remove devices with no table and multipath DM UUID
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
bmarzins authored and mwilck committed Nov 6, 2024
1 parent 7160b62 commit 65e38f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libmultipath/devmapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 65e38f2

Please sign in to comment.