OBS User unknown 2008-06-23 02:11:39 +00:00 committed by Git OBS Bridge
parent 3ae23c4f39
commit 1c0c21119e
10 changed files with 108 additions and 195 deletions

View File

@ -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
;;

View File

@ -1,36 +0,0 @@
based on
commit 519561f73f7ba987affde8b174d2691bb098439d
Author: Neil Brown <neilb@suse.de>
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:

View File

@ -1,70 +0,0 @@
based on
commit 6fb79233b050b4a3575f0e466ab04b5d301ac1de
Author: Neil Brown <neilb@suse.de>
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
)

View File

@ -1,76 +0,0 @@
Based on
commit 7a3be72fc621b4a7589e923cf0652c51493f831a
Author: Neil Brown <neilb@suse.de>
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;

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1d39f110eda550b9e7dbe9d1e56098ef77197029cb8c5f5d638d2c255feaf23d
size 152401

View File

@ -0,0 +1,31 @@
commit 56f8add211a840faaed325bd16483b55da544e93
Author: Neil Brown <neilb@suse.de>
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 */

View File

@ -0,0 +1,24 @@
commit 60b435db5a7b085ad1204168879037bf14ebd6d1
Author: Chris Webb <chris@arachsys.com>
Date: Thu Jun 19 16:30:39 2008 +1000
Fix bug in forced assemble.
From: Chris Webb <chris@arachsys.com>
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);

3
mdadm-2.6.7.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f2ec116bb1fc0102861796bc56777e751ea65202b460b0d43ae6ad277def807e
size 153982

View File

@ -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

View File

@ -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