commit multipath-tools for openSUSE:12.2
Hello community, here is the log from the commit of package multipath-tools for openSUSE:12.2 checked in at 2012-07-31 14:04:51 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:12.2/multipath-tools (Old) and /work/SRC/openSUSE:12.2/.multipath-tools.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "multipath-tools", Maintainer is "hare@suse.com" Changes: -------- --- /work/SRC/openSUSE:12.2/multipath-tools/multipath-tools.changes 2012-07-18 17:34:01.000000000 +0200 +++ /work/SRC/openSUSE:12.2/.multipath-tools.new/multipath-tools.changes 2012-07-31 14:15:37.000000000 +0200 @@ -1,0 +2,6 @@ +Wed Jul 25 13:04:59 UTC 2012 - puzel@suse.com + +- add kpartx-rules-create-dmraid-nodes.patch (bnc#769982) +- add kpartx-work-correctly-with-empty-GPT-table.patch + +------------------------------------------------------------------- New: ---- kpartx-rules-create-dmraid-nodes.patch kpartx-work-correctly-with-empty-GPT-table.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ multipath-tools.spec ++++++ --- /var/tmp/diff_new_pack.hQfi3s/_old 2012-07-31 14:15:38.000000000 +0200 +++ /var/tmp/diff_new_pack.hQfi3s/_new 2012-07-31 14:15:38.000000000 +0200 @@ -33,6 +33,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build Patch0: %{name}-%{version}-opensuse-12.2.diff.bz2 Patch1: 0002-fix-installation-of-multipath-rule.patch +Patch2: kpartx-work-correctly-with-empty-GPT-table.patch +Patch3: kpartx-rules-create-dmraid-nodes.patch %description This package provides the tools to manage multipathed devices by @@ -74,6 +76,8 @@ %setup -q -n multipath-tools-%{version} %patch0 -p1 %patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build make CC="%__cc" OPTFLAGS="$RPM_OPT_FLAGS" LIB=%_lib ++++++ kpartx-rules-create-dmraid-nodes.patch ++++++ Index: multipath-tools-0.4.9/kpartx/kpartx.rules =================================================================== --- multipath-tools-0.4.9.orig/kpartx/kpartx.rules +++ multipath-tools-0.4.9/kpartx/kpartx.rules @@ -17,6 +17,10 @@ OPTIONS="link_priority=50" ENV{DM_UUID}=="mpath-*", \ SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_NAME}" +# Create persistent links for dmraid tables +ENV{DM_UUID}=="DMRAID-*|dmraid-*", \ + SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_NAME}" + # Create persistent links for partitions ENV{DM_PART}=="?*", \ SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_NAME}-part$env{DM_PART}" @@ -25,6 +29,9 @@ ENV{DM_PART}=="?*", \ ENV{DM_STATE}=="ACTIVE", ENV{DM_UUID}=="mpath-*", \ RUN+="/sbin/kpartx -u -p -part /dev/$name" +ENV{DM_STATE}=="ACTIVE", ENV{DM_UUID}=="DMRAID-*|dmraid-*", \ + RUN+="/sbin/kpartx -u -p _part /dev/$kernel" + LABEL="kpartx_end" ++++++ kpartx-work-correctly-with-empty-GPT-table.patch ++++++
When running the partition table probes, the code considered empty tables as invalid ones. Because of this, kpartx -u / -d does not work correctly on empty tables (with zero partitions). The return value of the probes should be: -1: not our partition table type 0: our partition table, but no partitions exist
0: number of partitions found
Adapt read_gpt_pt() to this semantics. CC: Hannes Reinecke <hare@suse.com> CC: Christophe Varoqui <christophe.varoqui@gmail.com> Signed-off-by: Petr Uzel <petr.uzel@suse.cz> --- kpartx/gpt.c | 6 +++--- kpartx/kpartx.c | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) Index: multipath-tools-0.4.9/kpartx/gpt.c =================================================================== --- multipath-tools-0.4.9.orig/kpartx/gpt.c +++ multipath-tools-0.4.9/kpartx/gpt.c @@ -625,8 +625,8 @@ find_valid_gpt(int fd, gpt_header ** gpt * @fd * @all - slice with start/size of whole disk * - * 0 if this isn't our partition table - * number of partitions if successful + * -1 if this isn't our partition table + * number of partitions if successful (>= 0) * */ int @@ -643,7 +643,7 @@ read_gpt_pt (int fd, struct slice all, s free (gpt); if (ptes) free (ptes); - return 0; + return -1; } for (i = 0; i < __le32_to_cpu(gpt->num_partition_entries) && i < ns; i++) { Index: multipath-tools-0.4.9/kpartx/kpartx.c =================================================================== --- multipath-tools-0.4.9.orig/kpartx/kpartx.c +++ multipath-tools-0.4.9/kpartx/kpartx.c @@ -368,12 +368,10 @@ main(int argc, char **argv){ /* here we get partitions */ n = ptp->fn(fd, all, slices, SIZE(slices)); + if (n >= 0) { #ifdef DEBUG - if (n >= 0) printf("%s: %d slices\n", ptp->type, n); #endif - - if (n > 0) { close(fd); fd = -1; } @@ -607,7 +605,7 @@ main(int argc, char **argv){ break; } - if (n > 0) + if (n >= 0) break; } if (what == LIST && loopcreated && S_ISREG (buf.st_mode)) { -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de