diff --git a/multipath-tools-kpartx-wrong-partition-offset b/multipath-tools-kpartx-wrong-partition-offset new file mode 100644 index 0000000..219f103 --- /dev/null +++ b/multipath-tools-kpartx-wrong-partition-offset @@ -0,0 +1,37 @@ +commit 6d1bf23952e810ce41dd9f9d25e817eb56ecf93f +Author: Hannes Reinecke +Date: Tue May 27 14:07:37 2008 +0200 + + kpartx: Fixup stacked device offset + + For stacked devices we should calculate the offset relative to + the enclosing partition, not the entire device. + + References: 394658 + Signed-off-by: Hannes Reinecke + +diff --git a/kpartx/kpartx.c b/kpartx/kpartx.c +index 13d039d..68f17c8 100644 +--- a/kpartx/kpartx.c ++++ b/kpartx/kpartx.c +@@ -467,6 +467,7 @@ main(int argc, char **argv){ + d = c; + while (c) { + for (j = 0; j < n; j++) { ++ uint64_t start; + int k = slices[j].container - 1; + + if (slices[j].size == 0) +@@ -492,10 +493,11 @@ main(int argc, char **argv){ + } + strip_slash(partname); + ++ start = slices[j].start - slices[k].start; + if (safe_sprintf(params, "%d:%d %" PRIu64, + slices[k].major, + slices[k].minor, +- slices[j].start)) { ++ start)) { + fprintf(stderr, "params too small\n"); + exit(1); + } diff --git a/multipath-tools.changes b/multipath-tools.changes index 066ab54..82c5533 100644 --- a/multipath-tools.changes +++ b/multipath-tools.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed May 28 09:50:28 CEST 2008 - hare@suse.de + +- Calculate correct partition offset in kpartx (bnc#394658) + ------------------------------------------------------------------- Fri May 9 13:25:30 CEST 2008 - hare@suse.de diff --git a/multipath-tools.spec b/multipath-tools.spec index 41cf813..0fbe613 100644 --- a/multipath-tools.spec +++ b/multipath-tools.spec @@ -20,7 +20,7 @@ Requires: device-mapper kpartx PreReq: %insserv_prereq %fillup_prereq coreutils grep diffutils AutoReqProv: on Version: 0.4.7 -Release: 122 +Release: 125 Summary: Tools to Manage Multipathed Devices with the device-mapper Source: multipath-tools-%{version}.tar.bz2 Source1: multipath.init.suse @@ -39,6 +39,7 @@ Patch10: %{name}-remove-DAEMON-defines Patch11: %{name}-suse-build-fixes Patch12: %{name}-add-dm_linear Patch13: %{name}-use-underscore-for-partnames +Patch14: %{name}-kpartx-wrong-partition-offset %description This package provides the tools to manage multipathed devices by @@ -93,6 +94,7 @@ Authors: %patch11 -p1 %patch12 -p1 %patch13 -p1 +%patch14 -p1 cp %{S:1} multipath/multipath.init.suse %build @@ -150,6 +152,8 @@ mkdir -p $RPM_BUILD_ROOT/var/cache/multipath/ %{_mandir}/man8/kpartx.8* %changelog +* Wed May 28 2008 hare@suse.de +- Calculate correct partition offset in kpartx (bnc#394658) * Fri May 09 2008 hare@suse.de - Fixup kpartx rules (bnc#387667) * Tue Apr 29 2008 hare@suse.de