On Sat, 2017-05-06 at 00:30 +0200, Martin Wilck wrote: > On Fri, 2017-05-05 at 23:18 +0100, Alasdair G Kergon wrote: > > On Sat, May 06, 2017 at 12:05:49AM +0200, Martin Wilck wrote: > > > 3) kpartx should only delete "partitions", which are single- > > > target > > > linear mappings into a block device. Other maps should not > > > be > > > touched. > > > > The prefix on the dm device's uuid should guarantee this: all > > devices > > kpartx creates should have the same initial characters (a > > not-quite-standard form "part" IIRC instead of "KPARTX-") and any > > devices without those initial characters must be ignored. > > This works only for partitions on DM devices, not e.g. for loop > devices. These devices obviously have no DM UUID; and thus kpartx > also > doesn't set an UUID for the partition devices it creates. > That's the main point of this series. Moreover: before even looking at the UUID, kpartx discards mappings that are not "linear" and don't map into the device in question. I added the additional case that it should also disregard mappings with two or more targets which can't be regarded as simple "linear" type (but in the current code, they are). With the UUID test in place, this may seem kind of redundant, but it follows the general logic that obvious non-partition devices should be discarded before checking the UUID. Martin -- Dr. Martin Wilck <mwilck@xxxxxxxx>, Tel. +49 (0)911 74053 2107 SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel