use factory
OBS-URL: https://build.opensuse.org/package/show/Base:System/multipath-tools?expand=0&rev=9
This commit is contained in:
parent
baa09c67f6
commit
9e68a06ec3
@ -1,13 +0,0 @@
|
|||||||
Index: kpartx/kpartx.c
|
|
||||||
===================================================================
|
|
||||||
--- kpartx/kpartx.c.orig
|
|
||||||
+++ kpartx/kpartx.c
|
|
||||||
@@ -578,7 +578,7 @@ main(int argc, char **argv){
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (!dm_simplecmd(DM_DEVICE_REMOVE,
|
|
||||||
- partname)) {
|
|
||||||
+ partname, 1)) {
|
|
||||||
r++;
|
|
||||||
continue;
|
|
||||||
}
|
|
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:507361270bd9d1c703a265834334ba5d39f3d2d4677dd531ab23611c845fb381
|
oid sha256:6ee2872ba8dd45be1f365c3e1cc76fc1e4294eca617e6830cf9a51b60173403b
|
||||||
size 131381
|
size 131574
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Jan 27 16:16:12 CST 2010 - cmeng@novell.com
|
||||||
|
|
||||||
|
- Fix 'multipath -F' can't remove logical partitions (bnc#551827)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Oct 22 16:29:35 CEST 2009 - hare@suse.de
|
||||||
|
|
||||||
|
- Make 'param' local (bnc#548708)
|
||||||
|
- Include multipath-fix.patch in git tree.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Sep 8 20:56:53 UTC 2009 - aj@suse.de
|
Tue Sep 8 20:56:53 UTC 2009 - aj@suse.de
|
||||||
|
|
||||||
|
@ -27,12 +27,12 @@ Requires: device-mapper kpartx
|
|||||||
PreReq: %insserv_prereq %fillup_prereq coreutils grep
|
PreReq: %insserv_prereq %fillup_prereq coreutils grep
|
||||||
AutoReqProv: on
|
AutoReqProv: on
|
||||||
Version: 0.4.8
|
Version: 0.4.8
|
||||||
Release: 43
|
Release: 44.<RELEASE2>
|
||||||
Summary: Tools to Manage Multipathed Devices with the device-mapper
|
Summary: Tools to Manage Multipathed Devices with the device-mapper
|
||||||
Source: multipath-tools-%{version}.tar.bz2
|
Source: multipath-tools-%{version}.tar.bz2
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
Patch0: %{name}-%{version}-opensuse-11.2.diff.bz2
|
Patch0: %{name}-%{version}-opensuse-11.2.diff.bz2
|
||||||
Patch1: multipath-fix.patch
|
Patch1: remove-stacked-partitions.diff
|
||||||
|
|
||||||
%description
|
%description
|
||||||
This package provides the tools to manage multipathed devices by
|
This package provides the tools to manage multipathed devices by
|
||||||
@ -74,7 +74,7 @@ Authors:
|
|||||||
%prep
|
%prep
|
||||||
%setup -q -n multipath-tools-%{version}
|
%setup -q -n multipath-tools-%{version}
|
||||||
%patch0 -p1
|
%patch0 -p1
|
||||||
%patch1
|
%patch1 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# This package failed when testing with -Wl,-as-needed being default.
|
# This package failed when testing with -Wl,-as-needed being default.
|
||||||
|
104
remove-stacked-partitions.diff
Normal file
104
remove-stacked-partitions.diff
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
Index: multipath-tools-0.4.8/libmultipath/devmapper.c
|
||||||
|
===================================================================
|
||||||
|
--- multipath-tools-0.4.8.orig/libmultipath/devmapper.c
|
||||||
|
+++ multipath-tools-0.4.8/libmultipath/devmapper.c
|
||||||
|
@@ -912,6 +912,60 @@ bad:
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
+dm_get_full_uuid(char *name, char *uuid)
|
||||||
|
+{
|
||||||
|
+ struct dm_task *dmt;
|
||||||
|
+ const char *uuidtmp;
|
||||||
|
+ int r = 1;
|
||||||
|
+
|
||||||
|
+ dmt = dm_task_create(DM_DEVICE_INFO);
|
||||||
|
+ if (!dmt)
|
||||||
|
+ return 1;
|
||||||
|
+
|
||||||
|
+ if (!dm_task_set_name (dmt, name))
|
||||||
|
+ goto uuidout;
|
||||||
|
+
|
||||||
|
+ if (!dm_task_run(dmt))
|
||||||
|
+ goto uuidout;
|
||||||
|
+
|
||||||
|
+ uuidtmp = dm_task_get_uuid(dmt);
|
||||||
|
+ if (uuidtmp) {
|
||||||
|
+ strcpy(uuid, uuidtmp);
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ uuid[0] = '\0';
|
||||||
|
+
|
||||||
|
+ r = 0;
|
||||||
|
+uuidout:
|
||||||
|
+ dm_task_destroy(dmt);
|
||||||
|
+ return r;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * returns:
|
||||||
|
+ * 0 : if both uuids end with same suffix which starts with UUID_PREFIX
|
||||||
|
+ * 1 : otherwise
|
||||||
|
+ */
|
||||||
|
+int
|
||||||
|
+dm_compare_uuid(const char* mapname1, const char* mapname2)
|
||||||
|
+{
|
||||||
|
+ char *p1, *p2;
|
||||||
|
+ char uuid1[WWID_SIZE], uuid2[WWID_SIZE];
|
||||||
|
+
|
||||||
|
+ if (dm_get_full_uuid(mapname1, uuid1))
|
||||||
|
+ return 1;
|
||||||
|
+
|
||||||
|
+ if (dm_get_full_uuid(mapname2, uuid2))
|
||||||
|
+ return 1;
|
||||||
|
+
|
||||||
|
+ p1 = strstr(uuid1, UUID_PREFIX);
|
||||||
|
+ p2 = strstr(uuid2, UUID_PREFIX);
|
||||||
|
+ if (p1 && p2 && !strcmp(p1, p2))
|
||||||
|
+ return 0;
|
||||||
|
+
|
||||||
|
+ return 1;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
int
|
||||||
|
dm_remove_partmaps (const char * mapname)
|
||||||
|
{
|
||||||
|
@@ -950,15 +1004,10 @@ dm_remove_partmaps (const char * mapname
|
||||||
|
(dm_type(names->name, TGT_PART) > 0) &&
|
||||||
|
|
||||||
|
/*
|
||||||
|
- * and the multipath mapname and the part mapname start
|
||||||
|
- * the same
|
||||||
|
+ * and the both uuid end with same suffix which
|
||||||
|
+ * starts with UUID_PREFIX
|
||||||
|
*/
|
||||||
|
- !strncmp(names->name, mapname, strlen(mapname)) &&
|
||||||
|
-
|
||||||
|
- /*
|
||||||
|
- * and the opencount is 0 for us to allow removal
|
||||||
|
- */
|
||||||
|
- !dm_get_opencount(names->name) &&
|
||||||
|
+ !dm_compare_uuid(names->name, mapname) &&
|
||||||
|
|
||||||
|
/*
|
||||||
|
* and we can fetch the map table from the kernel
|
||||||
|
@@ -974,6 +1023,19 @@ dm_remove_partmaps (const char * mapname
|
||||||
|
* then it's a kpartx generated partition.
|
||||||
|
* remove it.
|
||||||
|
*/
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * if the opencount is not 0, maybe some other
|
||||||
|
+ * partitons depend on it.
|
||||||
|
+ */
|
||||||
|
+ if (dm_get_opencount(names->name)) {
|
||||||
|
+ dm_remove_partmaps(names->name);
|
||||||
|
+ if (dm_get_opencount(names->name)) {
|
||||||
|
+ condlog(2, "%s: map in use", names->name);
|
||||||
|
+ goto out;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
condlog(4, "partition map %s removed",
|
||||||
|
names->name);
|
||||||
|
dm_simplecmd_flush(DM_DEVICE_REMOVE, names->name);
|
Loading…
x
Reference in New Issue
Block a user