From bc4cbaecaa0259b62f8afac0bc34bcf30eaa0623c22b188e701bb8e5badfe24e Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Mon, 23 Jun 2008 02:11:39 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=10 --- boot.md | 5 ++- mdadm-2.6.4-519561f7.patch | 36 ------------------ mdadm-2.6.4-6fb79233.patch | 70 ----------------------------------- mdadm-2.6.4-7a3be72f.patch | 76 -------------------------------------- mdadm-2.6.4.tar.bz2 | 3 -- mdadm-2.6.7-56f8add2.patch | 31 ++++++++++++++++ mdadm-2.6.7-60b435db.patch | 24 ++++++++++++ mdadm-2.6.7.tar.bz2 | 3 ++ mdadm.changes | 21 +++++++++++ mdadm.spec | 34 ++++++++++++----- 10 files changed, 108 insertions(+), 195 deletions(-) delete mode 100644 mdadm-2.6.4-519561f7.patch delete mode 100644 mdadm-2.6.4-6fb79233.patch delete mode 100644 mdadm-2.6.4-7a3be72f.patch delete mode 100644 mdadm-2.6.4.tar.bz2 create mode 100644 mdadm-2.6.7-56f8add2.patch create mode 100644 mdadm-2.6.7-60b435db.patch create mode 100644 mdadm-2.6.7.tar.bz2 diff --git a/boot.md b/boot.md index 4ba85d0..b354d43 100644 --- a/boot.md +++ b/boot.md @@ -130,9 +130,11 @@ case "$1" in rm -rf /tmp/mdadm.conf if ! mdadm --examine --scan --config=partitions >/tmp/mdadm.conf then + echo "mdadm --examine --scan failed:" + cat /tmp/mdadm.conf + rm -f /tmp/mdadm.conf rc_failed 1 rc_status -v - chmod 0600 /tmp/mdadm.conf rc_exit fi chmod 0600 /tmp/mdadm.conf @@ -143,6 +145,7 @@ case "$1" in # no partitions found, "unused" rc_status -u fi + rm -f /tmp/mdadm.conf fi ;; diff --git a/mdadm-2.6.4-519561f7.patch b/mdadm-2.6.4-519561f7.patch deleted file mode 100644 index 40abc2d..0000000 --- a/mdadm-2.6.4-519561f7.patch +++ /dev/null @@ -1,36 +0,0 @@ -based on - - commit 519561f73f7ba987affde8b174d2691bb098439d - Author: Neil Brown - Date: Tue Apr 29 17:13:53 2008 +1000 - - Fix possible bug with bitmap space allocation with v1.0 metadata - - When adding a device to an array, make sure we don't reserve - so much space for the bitmap that there isn't room for the data. - -(minus the roff comments change) ---- - super1.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - ---- super1.c.orig -+++ super1.c -@@ -903,7 +903,7 @@ static int write_init_super1(struct supe - * for a bitmap. - */ - array_size = __le64_to_cpu(sb->size); -- /* work out how much space we left of a bitmap */ -+ /* work out how much space we left for a bitmap */ - bm_space = choose_bm_space(array_size); - - switch(st->minor_version) { -@@ -913,6 +913,8 @@ static int write_init_super1(struct supe - sb_offset &= ~(4*2-1); - sb->super_offset = __cpu_to_le64(sb_offset); - sb->data_offset = __cpu_to_le64(0); -+ if (sb_offset - bm_space < array_size) -+ bm_space = sb_offset - array_size; - sb->data_size = __cpu_to_le64(sb_offset - bm_space); - break; - case 1: diff --git a/mdadm-2.6.4-6fb79233.patch b/mdadm-2.6.4-6fb79233.patch deleted file mode 100644 index 4ad2a98..0000000 --- a/mdadm-2.6.4-6fb79233.patch +++ /dev/null @@ -1,70 +0,0 @@ -based on - commit 6fb79233b050b4a3575f0e466ab04b5d301ac1de - Author: Neil Brown - Date: Mon Apr 28 16:30:09 2008 +1000 - - Allow creation of a RAID6 with a single missing device. - - This did not work before as we couldn't mark it clean as there would - be some parity blocks out of sync, and raid6 will not assemble a - dirty degraded array. - So make such arrays doubly degraded (the last device becomes a spare) - and clean. - ---- - Create.c | 20 ++++++++++++++++++-- - 1 file changed, 18 insertions(+), 2 deletions(-) - ---- Create.c.orig -+++ Create.c -@@ -63,6 +63,7 @@ int Create(struct supertype *st, char *m - int fail=0, warn=0; - struct stat stb; - int first_missing = subdevs * 2; -+ int second_missing = subdevs * 2; - int missing_disks = 0; - int insert_point = subdevs * 2; /* where to insert a missing drive */ - void *super; -@@ -203,6 +204,8 @@ int Create(struct supertype *st, char *m - if (strcasecmp(dname, "missing")==0) { - if (first_missing > dnum) - first_missing = dnum; -+ if (second_missing > dnum && dnum > first_missing) -+ second_missing = dnum; - missing_disks ++; - continue; - } -@@ -341,6 +344,18 @@ int Create(struct supertype *st, char *m - break; - } - } -+ /* For raid6, if creating with 1 missing drive, make a good drive -+ * into a spare, else the create will fail -+ */ -+ if (assume_clean == 0 && force == 0 && first_missing < raiddisks && -+ second_missing >= raiddisks && level == 6) { -+ insert_point = raiddisks - 1; -+ if (insert_point == first_missing) -+ insert_point--; -+ sparedisks ++; -+ array.active_disks--; -+ missing_disks++; -+ } - - if (level <= 0 && first_missing != subdevs * 2) { - fprintf(stderr, -@@ -360,11 +375,12 @@ int Create(struct supertype *st, char *m - if (fstat(mdfd, &stb)==0) - array.md_minor = minor(stb.st_rdev); - array.not_persistent = 0; -- /*** FIX: Need to do something about RAID-6 here ***/ -+ - if ( ( (level == 4 || level == 5) && - (insert_point < raiddisks || first_missing < raiddisks) ) - || -- ( level == 6 && missing_disks == 2) -+ ( level == 6 && (insert_point < raiddisks -+ || second_missing < raiddisks)) - || - assume_clean - ) diff --git a/mdadm-2.6.4-7a3be72f.patch b/mdadm-2.6.4-7a3be72f.patch deleted file mode 100644 index e4d21b1..0000000 --- a/mdadm-2.6.4-7a3be72f.patch +++ /dev/null @@ -1,76 +0,0 @@ -Based on - commit 7a3be72fc621b4a7589e923cf0652c51493f831a - Author: Neil Brown - Date: Mon Apr 28 16:29:37 2008 +1000 - - Fix problems with array.size overflowing on large arrays. - - array.size is 32bits and counts K. So for arrays with - more than 4Terrabytes, it can overflow. - The correct number can be read from sysfs, but there are still - a few places that use array.size and risk truncation. What is worse. - they compare a number of kilobytes with a number of sectors !! - - So use get_component_size() to read the sysfs information, and be - more consistent about units. - ---- - Detail.c | 2 +- - Manage.c | 14 ++++++++++++-- - 2 files changed, 13 insertions(+), 3 deletions(-) - ---- Detail.c.orig -+++ Detail.c -@@ -174,7 +174,7 @@ int Detail(char *dev, int brief, int exp - if (dsize > 0) - printf(" Used Dev Size : %llu%s\n", - dsize, -- human_size((long long)array.size<<10)); -+ human_size((long long)dsize<<10)); - else - printf(" Used Dev Size : unknown\n"); - } else ---- Manage.c.orig -+++ Manage.c -@@ -188,6 +188,7 @@ int Manage_subdevs(char *devname, int fd - */ - mdu_array_info_t array; - mdu_disk_info_t disc; -+ unsigned long long array_size; - mddev_dev_t dv, next = NULL; - struct stat stb; - int j, jnext = 0; -@@ -203,6 +204,15 @@ int Manage_subdevs(char *devname, int fd - devname); - return 1; - } -+ -+ /* array.size is only 32 bit and may be truncated. -+ * So read from sysfs if possible, and record number of sectors -+ */ -+ -+ array_size = get_component_size(fd); -+ if (array_size <= 0) -+ array_size = array.size * 2; -+ - for (dv = devlist, j=0 ; dv; dv = next, j = jnext) { - unsigned long long ldsize; - char dvname[20]; -@@ -335,7 +345,7 @@ int Manage_subdevs(char *devname, int fd - - /* Make sure device is large enough */ - if (st->ss->avail_size(st, ldsize/512) < -- array.size) { -+ array_size) { - fprintf(stderr, Name ": %s not large enough to join array\n", - dv->devname); - return 1; -@@ -409,7 +419,7 @@ int Manage_subdevs(char *devname, int fd - /* non-persistent. Must ensure that new drive - * is at least array.size big. - */ -- if (ldsize/512 < array.size) { -+ if (ldsize/512 < array_size) { - fprintf(stderr, Name ": %s not large enough to join array\n", - dv->devname); - return 1; diff --git a/mdadm-2.6.4.tar.bz2 b/mdadm-2.6.4.tar.bz2 deleted file mode 100644 index e0c9ab7..0000000 --- a/mdadm-2.6.4.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1d39f110eda550b9e7dbe9d1e56098ef77197029cb8c5f5d638d2c255feaf23d -size 152401 diff --git a/mdadm-2.6.7-56f8add2.patch b/mdadm-2.6.7-56f8add2.patch new file mode 100644 index 0000000..107eae9 --- /dev/null +++ b/mdadm-2.6.7-56f8add2.patch @@ -0,0 +1,31 @@ +commit 56f8add211a840faaed325bd16483b55da544e93 +Author: Neil Brown +Date: Thu Jun 19 16:30:36 2008 +1000 + + Fix an error when assembling arrays that are in the middle of a reshape. + + It is important that dup_super always returns an 'st' with the same + ->ss and ->minor_version as the st that was passed. + This wasn't happening for 0.91 metadata (i.e. in the middle of a reshape). + +diff --git a/super0.c b/super0.c +index 7e81482..8e4c568 100644 +--- a/super0.c ++++ b/super0.c +@@ -849,12 +849,15 @@ static struct supertype *match_metadata_desc0(char *arg) + st->sb = NULL; + if (strcmp(arg, "0") == 0 || + strcmp(arg, "0.90") == 0 || +- strcmp(arg, "0.91") == 0 || + strcmp(arg, "default") == 0 || + strcmp(arg, "") == 0 /* no metadata */ + ) + return st; + ++ st->minor_version = 91; /* reshape in progress */ ++ if (strcmp(arg, "0.91") == 0) /* For dup_super support */ ++ return st; ++ + st->minor_version = 9; /* flag for 'byte-swapped' */ + if (strcmp(arg, "0.swap")==0 || + strcmp(arg, "0.9") == 0) /* For dup_super support */ diff --git a/mdadm-2.6.7-60b435db.patch b/mdadm-2.6.7-60b435db.patch new file mode 100644 index 0000000..a1f896c --- /dev/null +++ b/mdadm-2.6.7-60b435db.patch @@ -0,0 +1,24 @@ +commit 60b435db5a7b085ad1204168879037bf14ebd6d1 +Author: Chris Webb +Date: Thu Jun 19 16:30:39 2008 +1000 + + Fix bug in forced assemble. + + From: Chris Webb + + We are loading into the already-loaded 'st' instead of the + newly create 'tst', which is clearly wrong. + +diff --git a/Assemble.c b/Assemble.c +index 36b2304..79f0912 100644 +--- a/Assemble.c ++++ b/Assemble.c +@@ -656,7 +656,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd, + continue; + } + tst = dup_super(st); +- if (tst->ss->load_super(st,fd, NULL)) { ++ if (tst->ss->load_super(tst,fd, NULL)) { + close(fd); + fprintf(stderr, Name ": RAID superblock disappeared from %s - not updating.\n", + devices[chosen_drive].devname); diff --git a/mdadm-2.6.7.tar.bz2 b/mdadm-2.6.7.tar.bz2 new file mode 100644 index 0000000..8dd2cd3 --- /dev/null +++ b/mdadm-2.6.7.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f2ec116bb1fc0102861796bc56777e751ea65202b460b0d43ae6ad277def807e +size 153982 diff --git a/mdadm.changes b/mdadm.changes index 3c4c3ed..dab5c84 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,24 @@ +------------------------------------------------------------------- +Fri Jun 20 14:28:20 CEST 2008 - mmarek@suse.cz + +- updated to 2.6.7 + fixes from git + * Avoid segfault when parsing /proc/mdstat with auto-read-only + arrays. + * For v0.90 superblocks, print the 'Events' count as a real + count, not 2 numbers separated by a dot. + * Allow creation of a RAID6 with exactly one missing device. + * Use LOG_PID for syslog, so you get the pid of mdadm in the + log files. + * --export now works with --examine too (not just --detail) + * Improve auto-creation of device special file when using + --incremental + * Simple locking for --incremental so mdadm doesn't get + confused when run concurrently with itself. + * Make --incremental cope better with arrays that are being + reshaped. + * Fix autoassemble for stack arrays. +- remove /tmp/mdadm.conf in boot.md (bnc#401138) + ------------------------------------------------------------------- Wed Apr 30 15:57:14 CEST 2008 - mmarek@suse.cz diff --git a/mdadm.spec b/mdadm.spec index 23c9795..9823c19 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -1,5 +1,5 @@ # -# spec file for package mdadm (Version 2.6.4) +# spec file for package mdadm (Version 2.6.7) # # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -12,8 +12,8 @@ Name: mdadm -Version: 2.6.4 -Release: 37 +Version: 2.6.7 +Release: 1 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools @@ -28,9 +28,8 @@ Source1: Software-RAID.HOWTO.tar.bz2 Source2: sysconfig.mdadm Source3: mdadmd Source4: boot.md -Patch1: mdadm-2.6.4-7a3be72f.patch -Patch2: mdadm-2.6.4-6fb79233.patch -Patch3: mdadm-2.6.4-519561f7.patch +Patch1: mdadm-2.6.7-56f8add2.patch +Patch2: mdadm-2.6.7-60b435db.patch %description Mdadm is a program that can be used to control Linux md devices. It is @@ -45,9 +44,8 @@ Authors: %prep %setup -q -a1 -%patch1 -%patch2 -%patch3 +%patch1 -p1 +%patch2 -p1 %build %{suse_update_config -f} @@ -122,6 +120,24 @@ rm -rf $RPM_BUILD_ROOT %{_var}/adm/fillup-templates/sysconfig.mdadm %changelog +* Fri Jun 20 2008 mmarek@suse.cz +- updated to 2.6.7 + fixes from git + * Avoid segfault when parsing /proc/mdstat with auto-read-only + arrays. + * For v0.90 superblocks, print the 'Events' count as a real + count, not 2 numbers separated by a dot. + * Allow creation of a RAID6 with exactly one missing device. + * Use LOG_PID for syslog, so you get the pid of mdadm in the + log files. + * --export now works with --examine too (not just --detail) + * Improve auto-creation of device special file when using + --incremental + * Simple locking for --incremental so mdadm doesn't get + confused when run concurrently with itself. + * Make --incremental cope better with arrays that are being + reshaped. + * Fix autoassemble for stack arrays. +- remove /tmp/mdadm.conf in boot.md (bnc#401138) * Wed Apr 30 2008 mmarek@suse.cz - added some fixes from Neil's git repo, fixing bnc#368704 among others