1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

libdm: remove dm dev without error even with malformed UUID

On each ioctl return, the device UUID is decoded from \xNN format.
If the UUID of the device being *removed* is malformed (e.g. it
hasn't been corrected before), just remove it without any error
as the UUID is not needed anymore - the device is gone anyway.

Otherwise a misleading error message would be issued just after
the removal:
  # dmsetup remove test
  The UUID "a b" should be mangled but it contains blacklisted characters.
  Command failed
This commit is contained in:
Peter Rajnoha 2012-10-12 11:53:04 +02:00
parent 5a958655dd
commit abb07a1b5e

View File

@ -1762,7 +1762,8 @@ static struct dm_ioctl *_do_dm_ioctl(struct dm_task *dmt, unsigned command,
if (!_dm_ioctl_unmangle_names(dmt->type, dmi))
goto error;
if (!_dm_ioctl_unmangle_uuids(dmt->type, dmi))
if (dmt->type != DM_DEVICE_REMOVE &&
!_dm_ioctl_unmangle_uuids(dmt->type, dmi))
goto error;
#else /* Userspace alternative for testing */