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
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 pref
On Sat, May 06, 2017 at 12:05:57AM +0200, Martin Wilck wrote:
> Introduce a "fake" UUID for these devices to make sure kpartx
> deletes only devices it had created previously. Otherwise kpartx
> might e.g. delete LVM LVs that are inside a device it is trying
> to delete partitions for. It seems to
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 sh
This function is not used any more.
Signed-off-by: Martin Wilck
---
kpartx/lopart.c | 31 ---
kpartx/lopart.h | 1 -
2 files changed, 32 deletions(-)
diff --git a/kpartx/lopart.c b/kpartx/lopart.c
index 2eb3f631..44f0c277 100644
--- a/kpartx/lopart.c
+++ b/kpartx/lo
For dm devices, kpartx uses an UUID check at partition removal
to make sure it only deletes partitions it previously created.
Non-DM parent devices such as loop devices don't generally have
a UUID.
Introduce a "fake" UUID for these devices to make sure kpartx
deletes only devices it had created pr
Commit 3d709241 causes kpartx to attempt a dm ioctl on a loop
device. This causes an error message
"device-mapper: table ioctl on loop4 failed: No such device or address".
Fixes: 3d709241 "kpartx: sanitize delete partitions"
Signed-off-by: Martin Wilck
---
kpartx/kpartx.c | 2 +-
1 file changed,
This is a unit test program for kpartx, in particular for deleting
partitions.
NOTE: This test program fails with current kpartx; full patch series
needed to make it work.
Signed-off-by: Martin Wilck
---
kpartx/test-kpartx | 253 +
1 file chan
kpartx -d treats any map that has a "linear" mapping into a
device as first target as a partition of this device.
This is wrong, because linear mappings may consist of
several pieces, combining multiple devices into one
(LVM logical volumes are an example of such a
mapping). Partitions have to be s
kpartx supports being called for a regular file, in which
case it assumes that it should set up a loop device or use
an existing one. Because the loopinfo.lo_name field contains
an absolute path, matching with existing loop devices fails
for relative paths. Matching by basename only would be unreli
Rather then searching through all of /dev, look up loop devices
in /sys/devices/virtual/block. This is cleaner and more robust
(/dev/loop$Xp$Y symlinks may confuse kpartx).
Signed-off-by: Martin Wilck
---
kpartx/lopart.c | 42 +++---
1 file changed, 31 inserti
dm_type is used in libmultipath only to check whether a mapping
is "linear", with the intention to test if it represents a
"partition". This test returns TRUE also for mappings with
multiple targets, the first of which happens to be a linear
mapping into the target device. This is questionable, it'
For non-existent maps (ENXIO from ioctl()), dm_task_run and
dm_task_get_info return success. We need to check info.exists.
Signed-off-by: Martin Wilck
---
kpartx/devmapper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kpartx/devmapper.c b/kpartx/devmapper.c
index 8f48a705
Commit 3d709241 improved partition removal, but broke support
for handling partitions of non-dm devices such as loop devices
or RAM disks.
This requires passing the dev_t of the device down to
do_foreach_partmap(). Doing so, there's little use in trying
to derive major/minor numbers from the "map
Working on a bug report about kpartx not properly removing
partitions for loop devices, I realized a number of glitches
and improperly handled corner cases in the kpartx code for
deleting partitions. Some mappings are not deleted although
they should be, and others are deleted although that is clea
Hi Linus,
The following changes since commit 7b66f13207e60e7c550af730986e77e38a0c69a3:
Merge tag 'for-4.12/dm-post-merge-changes' of
git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
(2017-05-03 10:34:03 -0700)
are available in the git repository at:
git://git.kernel.or
On Thu, Apr 13, 2017 at 10:23:10PM -0400, Martin K. Petersen wrote:
> The other thing that keeps me a bit on the fence is that a bunch of the
> plumbing to handle a bio with a payload different from bi_size is needed
> for the copy offload token. I'm hoping to have those patches ready for
> 4.13. R
On Wed, 2017-05-03 at 10:33 -0400, Mike Snitzer wrote:
> On Tue, May 02 2017 at 11:33pm -0400,
> Nicholas A. Bellinger wrote:
>
> > On Tue, 2017-05-02 at 09:23 +0200, h...@lst.de wrote:
> > > On Tue, May 02, 2017 at 12:16:13AM -0700, Nicholas A. Bellinger wrote:
> > > > Or, another options is use
18 matches
Mail list logo