kpartx: sanitize delete partitions
authorHannes Reinecke <hare@suse.de>
Tue, 28 Feb 2017 16:23:25 +0000 (17:23 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Thu, 23 Mar 2017 08:26:57 +0000 (09:26 +0100)
commit3d709241c79e24cbc677b24f55a51d16bb9eb560
tree2e7c8b004aeaaabd68e2df46bc05e9e0625d7c8e
parentb51611894a8ce62b4eb8b71fe3281e2b4d641f13
kpartx: sanitize delete partitions

kpartx has a rather braindead method for deleting partitions;
generating 'possible' partition names and trying to remove all
of them.
With this patch kpartx looks at the device-mapper devices on top
of the referenced device, and removes them if they found to be
kpartx-generated devices.

Signed-off-by: Hannes Reinecke <hare@suse.com>
kpartx/devmapper.c
kpartx/devmapper.h
kpartx/kpartx.c