summaryrefslogtreecommitdiffstats
path: root/0009-RH-RHEL5-style-partitions.patch
diff options
context:
space:
mode:
authorBenjamin Marzinski <bmarzins@redhat.com>2013-03-02 17:03:30 -0600
committerBenjamin Marzinski <bmarzins@redhat.com>2013-03-02 17:03:30 -0600
commitd1207a7795f6efc52e321e735a92d7b3d80aaaba (patch)
treebb53dfc9c74896fe5467159dfb92a4fdf774f492 /0009-RH-RHEL5-style-partitions.patch
parent1a1eabcadfe8159ec0373b7a4cf7b2e058ea0db5 (diff)
downloaddevice-mapper-multipath-d1207a7795f6efc52e321e735a92d7b3d80aaaba.tar.gz
device-mapper-multipath-d1207a7795f6efc52e321e735a92d7b3d80aaaba.tar.xz
device-mapper-multipath-d1207a7795f6efc52e321e735a92d7b3d80aaaba.zip
device-mapper-multipath-0.4.9-45
Updated to latest upstrem 0.4.9 code: multipath-tools-130222 (git commit id: 67b82ad6fe280caa1770025a6bb8110b633fa136) Refresh 0001-RH-dont_start_with_no_config.patch Modify 0002-RH-multipath.rules.patch Modify 0003-RH-Make-build-system-RH-Fedora-friendly.patch Refresh 0004-RH-multipathd-blacklist-all-by-default.patch Refresh 0005-RH-add-mpathconf.patch Refresh 0006-RH-add-find-multipaths.patch Add 0008-RH-revert-partition-changes.patch Rename 0008-RH-RHEL5-style-partitions.patch to 0009-RH-RHEL5-style-partitions.patch Rename 0009-RH-dont-remove-map-on-enomem.patch to 0010-RH-dont-remove-map-on-enomem.patch Rename 0010-RH-deprecate-uid-gid-mode.patch to 0011-RH-deprecate-uid-gid-mode.patch Rename 0013-RH-kpartx-msg.patch to 0012-RH-kpartx-msg.patch Rename 0035-RHBZ-883981-cleanup-rpmdiff-issues.patch to 0013-RHBZ-883981-cleanup-rpmdiff-issues.patch Rename 0039-RH-handle-other-sector-sizes.patch to 0014-RH-handle-other-sector-sizes.patch Rename 0040-RH-fix-output-buffer.patch to 0015-RH-fix-output-buffer.patch Add 0016-RH-dont-print-ghost-messages.patch Add 0017-RH-fix-sigusr1.patch * Actually this fixes a number of issues related to signals Rename 0018-RH-remove-config-dups.patch to 0018-RH-fix-factorize.patch * just the part that isn't upstream Add 0019-RH-fix-sockets.patch * makes abstract multipathd a cli sockets use the correct name. Set find_multipaths in the default config
Diffstat (limited to '0009-RH-RHEL5-style-partitions.patch')
-rw-r--r--0009-RH-RHEL5-style-partitions.patch327
1 files changed, 327 insertions, 0 deletions
diff --git a/0009-RH-RHEL5-style-partitions.patch b/0009-RH-RHEL5-style-partitions.patch
new file mode 100644
index 0000000..a2691bb
--- /dev/null
+++ b/0009-RH-RHEL5-style-partitions.patch
@@ -0,0 +1,327 @@
+---
+ kpartx/bsd.c | 35 ---------------
+ kpartx/dos.c | 7 +--
+ kpartx/kpartx.c | 123 +++++++-------------------------------------------------
+ kpartx/kpartx.h | 1
+ kpartx/sun.c | 35 ---------------
+ 5 files changed, 24 insertions(+), 177 deletions(-)
+
+Index: multipath-tools-130222/kpartx/bsd.c
+===================================================================
+--- multipath-tools-130222.orig/kpartx/bsd.c
++++ multipath-tools-130222/kpartx/bsd.c
+@@ -50,10 +50,10 @@ int
+ read_bsd_pt(int fd, struct slice all, struct slice *sp, int ns) {
+ struct bsd_disklabel *l;
+ struct bsd_partition *p;
+- unsigned int offset = all.start, end;
++ unsigned int offset = all.start;
+ int max_partitions;
+ char *bp;
+- int n = 0, i, j;
++ int n = 0;
+
+ bp = getblock(fd, offset+1); /* 1 sector suffices */
+ if (bp == NULL)
+@@ -79,36 +79,5 @@ read_bsd_pt(int fd, struct slice all, st
+ break;
+ }
+ }
+- /*
+- * Convention has it that the bsd disklabel will always have
+- * the 'c' partition spanning the entire disk.
+- * So we have to check for contained slices.
+- */
+- for(i = 0; i < n; i++) {
+- if (sp[i].size == 0)
+- continue;
+-
+- end = sp[i].start + sp[i].size;
+- for(j = 0; j < n; j ++) {
+- if ( i == j )
+- continue;
+- if (sp[j].size == 0)
+- continue;
+-
+- if (sp[i].start < sp[j].start) {
+- if (end > sp[j].start &&
+- end < sp[j].start + sp[j].size) {
+- /* Invalid slice */
+- fprintf(stderr,
+- "bsd_disklabel: slice %d overlaps with %d\n", i , j);
+- sp[i].size = 0;
+- }
+- } else {
+- if (end <= sp[j].start + sp[j].size) {
+- sp[i].container = j + 1;
+- }
+- }
+- }
+- }
+ return n;
+ }
+Index: multipath-tools-130222/kpartx/dos.c
+===================================================================
+--- multipath-tools-130222.orig/kpartx/dos.c
++++ multipath-tools-130222/kpartx/dos.c
+@@ -16,7 +16,7 @@ is_extended(int type) {
+ }
+
+ static int
+-read_extended_partition(int fd, struct partition *ep, int en,
++read_extended_partition(int fd, struct partition *ep,
+ struct slice *sp, int ns)
+ {
+ struct partition p;
+@@ -53,7 +53,6 @@ read_extended_partition(int fd, struct p
+ if (n < ns) {
+ sp[n].start = here + le32_to_cpu(p.start_sect);
+ sp[n].size = le32_to_cpu(p.nr_sects);
+- sp[n].container = en + 1;
+ n++;
+ } else {
+ fprintf(stderr,
+@@ -98,7 +97,9 @@ read_dos_pt(int fd, struct slice all, st
+ break;
+ }
+ if (is_extended(p.sys_type)) {
+- n += read_extended_partition(fd, &p, i, sp+n, ns-n);
++ n += read_extended_partition(fd, &p, sp+n, ns-n);
++ /* hide the extended partition itself */
++ sp[i].size = 2;
+ }
+ }
+ return n;
+Index: multipath-tools-130222/kpartx/kpartx.c
+===================================================================
+--- multipath-tools-130222.orig/kpartx/kpartx.c
++++ multipath-tools-130222/kpartx/kpartx.c
+@@ -192,7 +192,7 @@ get_hotplug_device(void)
+
+ int
+ main(int argc, char **argv){
+- int i, j, m, n, op, off, arg, c, d, ro=0;
++ int i, j, m, n, op, off, arg, ro=0;
+ int fd = -1;
+ struct slice all;
+ struct pt *ptp;
+@@ -381,49 +381,30 @@ main(int argc, char **argv){
+ else
+ continue;
+
++ /*
++ * test for overlap, as in the case of an extended partition
++ * zero their size to avoid mapping
++ */
++ for (j = 0; j < n; j++) {
++ for (m = j + 1; m < n; m++) {
++ if (slices[m].start > slices[j].start &&
++ slices[m].start < slices[j].start +
++ slices[j].size)
++ slices[j].size = 0;
++ }
++ }
++
+ switch(what) {
+ case LIST:
+- for (j = 0, c = 0, m = 0; j < n; j++) {
++ for (j = 0; j < n; j++) {
+ if (slices[j].size == 0)
+ continue;
+- if (slices[j].container > 0) {
+- c++;
+- continue;
+- }
+-
+- slices[j].minor = m++;
+
+ printf("%s%s%d : 0 %" PRIu64 " %s %" PRIu64"\n",
+ mapname, delim, j+1,
+ slices[j].size, device,
+ slices[j].start);
+ }
+- /* Loop to resolve contained slices */
+- d = c;
+- while (c) {
+- for (j = 0; j < n; j++) {
+- uint64_t start;
+- int k = slices[j].container - 1;
+-
+- if (slices[j].size == 0)
+- continue;
+- if (slices[j].minor > 0)
+- continue;
+- if (slices[j].container == 0)
+- continue;
+- slices[j].minor = m++;
+-
+- start = slices[j].start - slices[k].start;
+- printf("%s%s%d : 0 %" PRIu64 " /dev/dm-%d %" PRIu64 "\n",
+- mapname, delim, j+1,
+- slices[j].size,
+- slices[k].minor, start);
+- c--;
+- }
+- /* Terminate loop if nothing more to resolve */
+- if (d == c)
+- break;
+- }
+
+ break;
+
+@@ -462,16 +443,10 @@ main(int argc, char **argv){
+ case ADD:
+ case UPDATE:
+ /* ADD and UPDATE share the same code that adds new partitions. */
+- for (j = 0, c = 0; j < n; j++) {
++ for (j = 0; j < n; j++) {
+ if (slices[j].size == 0)
+ continue;
+
+- /* Skip all contained slices */
+- if (slices[j].container > 0) {
+- c++;
+- continue;
+- }
+-
+ if (safe_sprintf(partname, "%s%s%d",
+ mapname, delim, j+1)) {
+ fprintf(stderr, "partname too small\n");
+@@ -512,72 +487,6 @@ main(int argc, char **argv){
+ slices[j].minor, slices[j].size,
+ DM_TARGET, params);
+ }
+- /* Loop to resolve contained slices */
+- d = c;
+- while (c) {
+- for (j = 0; j < n; j++) {
+- uint64_t start;
+- int k = slices[j].container - 1;
+-
+- if (slices[j].size == 0)
+- continue;
+-
+- /* Skip all existing slices */
+- if (slices[j].minor > 0)
+- continue;
+-
+- /* Skip all simple slices */
+- if (slices[j].container == 0)
+- continue;
+-
+- /* Check container slice */
+- if (slices[k].size == 0)
+- fprintf(stderr, "Invalid slice %d\n",
+- k);
+-
+- if (safe_sprintf(partname, "%s%s%d",
+- mapname, delim, j+1)) {
+- fprintf(stderr, "partname too small\n");
+- exit(1);
+- }
+- strip_slash(partname);
+-
+- start = slices[j].start - slices[k].start;
+- if (safe_sprintf(params, "%d:%d %" PRIu64,
+- slices[k].major,
+- slices[k].minor,
+- start)) {
+- fprintf(stderr, "params too small\n");
+- exit(1);
+- }
+-
+- op = (dm_map_present(partname) ?
+- DM_DEVICE_RELOAD : DM_DEVICE_CREATE);
+-
+- dm_addmap(op, partname, DM_TARGET, params,
+- slices[j].size, ro, uuid, j+1,
+- buf.st_mode & 0777,
+- buf.st_uid, buf.st_gid,
+- &cookie);
+-
+- if (op == DM_DEVICE_RELOAD)
+- dm_simplecmd(DM_DEVICE_RESUME,
+- partname, 1,
+- &cookie);
+-
+- dm_devn(partname, &slices[j].major,
+- &slices[j].minor);
+-
+- if (verbose)
+- printf("add map %s : 0 %" PRIu64 " %s %s\n",
+- partname, slices[j].size,
+- DM_TARGET, params);
+- c--;
+- }
+- /* Terminate loop */
+- if (d == c)
+- break;
+- }
+
+ if (what == ADD) {
+ /* Skip code that removes devmappings for deleted partitions */
+Index: multipath-tools-130222/kpartx/kpartx.h
+===================================================================
+--- multipath-tools-130222.orig/kpartx/kpartx.h
++++ multipath-tools-130222/kpartx/kpartx.h
+@@ -24,7 +24,6 @@
+ struct slice {
+ uint64_t start;
+ uint64_t size;
+- int container;
+ int major;
+ int minor;
+ };
+Index: multipath-tools-130222/kpartx/sun.c
+===================================================================
+--- multipath-tools-130222.orig/kpartx/sun.c
++++ multipath-tools-130222/kpartx/sun.c
+@@ -62,8 +62,8 @@ int
+ read_sun_pt(int fd, struct slice all, struct slice *sp, int ns) {
+ struct sun_disk_label *l;
+ struct sun_raw_part *s;
+- unsigned int offset = all.start, end;
+- int i, j, n;
++ unsigned int offset = all.start;
++ int i, n;
+ char *bp;
+
+ bp = getblock(fd, offset);
+@@ -95,37 +95,6 @@ read_sun_pt(int fd, struct slice all, st
+ break;
+ }
+ }
+- /*
+- * Convention has it that the SUN disklabel will always have
+- * the 'c' partition spanning the entire disk.
+- * So we have to check for contained slices.
+- */
+- for(i = 0; i < SUN_DISK_MAXPARTITIONS; i++) {
+- if (sp[i].size == 0)
+- continue;
+-
+- end = sp[i].start + sp[i].size;
+- for(j = 0; j < SUN_DISK_MAXPARTITIONS; j ++) {
+- if ( i == j )
+- continue;
+- if (sp[j].size == 0)
+- continue;
+-
+- if (sp[i].start < sp[j].start) {
+- if (end > sp[j].start &&
+- end < sp[j].start + sp[j].size) {
+- /* Invalid slice */
+- fprintf(stderr,
+- "sun_disklabel: slice %d overlaps with %d\n", i , j);
+- sp[i].size = 0;
+- }
+- } else {
+- if (end <= sp[j].start + sp[j].size) {
+- sp[i].container = j + 1;
+- }
+- }
+- }
+- }
+ return n;
+ }
+