diff options
author | madduck <madduck@3cfab66f-1918-0410-86b3-c06b76f9a464> | 2006-10-10 08:00:19 +0000 |
---|---|---|
committer | madduck <madduck@3cfab66f-1918-0410-86b3-c06b76f9a464> | 2006-10-10 08:00:19 +0000 |
commit | 7cefd9e944d4b9d786487a3adaaa6afdc7bc84db (patch) | |
tree | 8c315ebd7bb305186926cf56bbdff8e86e5445a2 | |
parent | 77040b11124d436e36c03ed94080c15684e6349b (diff) |
removing superblock overlap patch
-rw-r--r-- | debian/changelog | 13 | ||||
-rwxr-xr-x | debian/patches/50-superblock-partition-limit.dpatch | 128 |
2 files changed, 13 insertions, 128 deletions
diff --git a/debian/changelog b/debian/changelog index def2b79f..d8828b2a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +mdadm (2.5.3.git200610100838-1) unstable; urgency=low + + * Merged upstream changes: + - --examine now reports chunk size also for RAID6 and RAID10 + - fix endianness issues with v1 superblocks (closes: #385726) and bitmap + metadata. + - improved the message when mdadm detects similar superblocks + (closes: #385951). + * Removed patch previously used to fix #385951 because it's not adequate. + See the bug log for reasons. + + -- martin f. krafft <madduck@debian.org> Tue, 10 Oct 2006 08:38:50 +0200 + mdadm (2.5.3.git200608202239-8) unstable; urgency=low * This revision is dedicated to Peter Samuelson for his RAID10 expertise^W diff --git a/debian/patches/50-superblock-partition-limit.dpatch b/debian/patches/50-superblock-partition-limit.dpatch deleted file mode 100755 index 6e5df0a7..00000000 --- a/debian/patches/50-superblock-partition-limit.dpatch +++ /dev/null @@ -1,128 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 50-superblock-partition-limit.dpatch by martin f. krafft <madduck@debian.org> -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: No description. - -@DPATCH@ -diff -urNad mdadm.git~/config.c mdadm.git/config.c ---- mdadm.git~/config.c 2006-09-20 17:53:00.863178469 +0200 -+++ mdadm.git/config.c 2006-09-21 15:35:17.513157034 +0200 -@@ -219,31 +219,105 @@ - char *name; - } *cdevlist = NULL; - -+char* skipblanks(char* buf) -+{ -+ if (!buf) return buf; -+ while (*buf != '\0' && isblank(*buf)) ++buf; -+ return buf; -+} -+ -+char* skipnonblanks(char* buf) -+{ -+ if (!buf) return buf; -+ while (*buf != '\0' && !isblank(*buf)) ++buf; -+ return buf; -+} -+ -+char* skipdigits(char* buf) -+{ -+ if (!buf) return buf; -+ while (*buf != '\0' && isdigit(*buf)) ++buf; -+ return buf; -+} -+ - mddev_dev_t load_partitions(void) - { - FILE *f = fopen("/proc/partitions", "r"); -- char buf[1024]; -+ char buf[1024], last_device_name[1024]; -+ int last_major = -1; - mddev_dev_t rv = NULL; - if (f == NULL) { - fprintf(stderr, Name ": cannot open /proc/partitions\n"); - return NULL; - } -- while (fgets(buf, 1024, f)) { -- int major, minor; -- char *name, *mp; -+ while (!feof(f) && fgets(buf, 1024, f)) { -+ unsigned long major, minor; -+ char *name, *kernel_name, *mp, *ptr; - mddev_dev_t d; - -- buf[1023] = '\0'; -- if (buf[0] != ' ') -- continue; -+ /* -+ * All partition lines start with a space. -+ */ -+ if (buf[0] != ' ') continue; -+ -+ /* -+ * Chop at the end of each line. -+ */ -+ ptr = strchr(buf, '\n'); -+ if (ptr) *ptr = '\0'; -+ -+ /* -+ * Extract the major and minor numbers and obtain the device node name. -+ * 10 is the max number of digits expected in a major/minor number -+ * (32bit). -+ */ - major = strtoul(buf, &mp, 10); -- if (mp == buf || *mp != ' ') -- continue; -- minor = strtoul(mp, NULL, 10); -+ if (mp == buf || *mp != ' ') continue; -+ mp = skipblanks(mp); -+ minor = strtoul(mp, &mp, 10); -+ mp = skipblanks(mp); - - name = map_dev(major, minor, 1); -- if (!name) -- continue; -+ if (!name) continue; -+ -+ /* -+ * mp now points at the third field, which is digits only. We thus skip -+ * all spaces and digits to reach the forth field. -+ */ -+ mp = skipdigits(mp); -+ mp = skipblanks(mp); -+ -+ /* -+ * Now the cursor is at the beginning to the kernel name, so we point -+ * there and terminate the string on the first space character. -+ */ -+ kernel_name = mp; -+ mp = skipnonblanks(mp); -+ *mp = '\0'; -+ -+ /* -+ * Check if this could be a partition of the previous device -+ * (the disk _always_ comes just before the first partition, cf. -+ * /usr/src/linux/fs/partitions/check.c) -+ */ -+ if (major == last_major && strlen(kernel_name) > strlen(last_device_name) && -+ strncmp(kernel_name, last_device_name, strlen(last_device_name)) == 0 && -+ isdigit(kernel_name[strlen(kernel_name) - 1])) { -+ /* -+ * The previous device appears to have a partition table, so delete it -+ * so it isn't scanned for a superblock. This makes sure we don't get -+ * confused when a partition with an md superblock lives very close to -+ * the end of a disk. -+ */ -+ d = rv->next; -+ free(rv->devname); -+ free(rv); -+ rv = d; -+ } -+ -+ last_major = major; -+ strcpy(last_device_name, kernel_name); -+ - d = malloc(sizeof(*d)); - d->devname = strdup(name); - d->next = rv; |