Bug#763080: Fails to assemble a reshaping raid after disk hickup

2014-09-29 Thread Michael Tokarev
29.09.2014 06:56, NeilBrown wrote:
 On Sun, 28 Sep 2014 17:52:52 +0200 Goswin von Brederlow goswin-...@web.de
 wrote:
 
 
 And then when force_array only checks up to the number of disks in the
 array it misses half of them. In my case exactly those it should be
 forcing.
 
 This is fixed by upstream patch
 
 commit f81a2b56c4b437f66aaf5582a9c6b7f5ab2103c4
 Author: NeilBrown ne...@suse.de
 Date:   Tue Oct 22 09:55:04 2013 +1100
 
 Assembe: fix bug in force_array - it wasn't forcing properly.
 
 which is in mdadm-3.3.1.

Ow.  I overlooked this.  Thank you Neil for pointing it out.

I've 3.3.2 (with some more changes) ready to be releases in debian,
but I'm afraid it will be difficult due to udeb freeze.  Let's see...

Thanks,

/mjt


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#763080: Fails to assemble a reshaping raid after disk hickup

2014-09-29 Thread Michael Tokarev
Control: severity -1 important
[]
 Ow.  I overlooked this.  Thank you Neil for pointing it out.
 
 I've 3.3.2 (with some more changes) ready to be releases in debian,
 but I'm afraid it will be difficult due to udeb freeze.  Let's see...

And since this bug has a good potential to make your system unbootable,
I'm raising severity - probably should be raised even higher than
'important'...

Thanks,

/mjt


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#763080: Fails to assemble a reshaping raid after disk hickup

2014-09-28 Thread Goswin von Brederlow
Package: mdadm
Version: 3.3-2
Followup-For: Bug #763080

Hi,

attached a patch to make --force work with my reshaping array. The
problem seems to be that load_devices fills in the best array only for
every second slot (and makes it 4 times as big as needed):

mdadm: best[0] = 0
mdadm: best[1] = -1
mdadm: best[2] = 1
mdadm: best[3] = -1
mdadm: best[4] = 2
mdadm: best[5] = -1
mdadm: best[6] = 3
mdadm: best[7] = -1
mdadm: best[8] = 4
mdadm: best[9] = -1
mdadm: best[10] = 5
mdadm: best[11] = -1
mdadm: best[12] = -1
mdadm: best[13] = -1
mdadm: best[14] = -1
mdadm: best[15] = -1
mdadm: best[16] = -1
mdadm: best[17] = -1
mdadm: best[18] = -1
mdadm: best[19] = -1

And then when force_array only checks up to the number of disks in the
array it misses half of them. In my case exactly those it should be
forcing.

MfG
Goswin

-- Package-specific info:
-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.14-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash

Versions of packages mdadm depends on:
ii  debconf  1.5.53
ii  initscripts  2.88dsf-53
ii  libc62.19-1
ii  lsb-base 4.1+Debian12
ii  makedev  2.3.1-93
ii  udev 204-10

Versions of packages mdadm recommends:
ii  exim4-daemon-heavy [mail-transport-agent]  4.82-8
ii  module-init-tools  16-2

mdadm suggests no packages.

-- debconf information excluded
Description: Fix --force option for a reshaping array
 On a reshaping array the --force option can't find a suitable drive to
 force because it does not test all the available drives in the best array.
 For some reason only every second entry is filled in and only the first
 half gets tested when going by disk count instead of bestcnt.
 .
 This might also happen with normal arrays, I've only tested it on the one
 broken array I have here.
Author: Goswin von Brederlow goswin-...@web.de

---
--- mdadm-3.3.orig/Assemble.c
+++ mdadm-3.3/Assemble.c
@@ -803,7 +803,7 @@ static int force_array(struct mdinfo *co
 		int chosen_drive = -1;
 		int i;
 
-		for (i = 0; i  content-array.raid_disks  i  bestcnt; i++) {
+		for (i = 0; i  bestcnt; i++) {
 			int j = best[i];
 			if (j=0 
 			!devices[j].uptodate 
@@ -813,8 +813,10 @@ static int force_array(struct mdinfo *co
 			  devices[chosen_drive].i.events))
 chosen_drive = j;
 		}
-		if (chosen_drive  0)
+		if (chosen_drive  0) {
+			pr_err(couldn't choose a drive to force\n);
 			break;
+		}
 		current_events = devices[chosen_drive].i.events;
 	add_another:
 		if (c-verbose = 0)


Bug#763080: Fails to assemble a reshaping raid after disk hickup

2014-09-28 Thread NeilBrown
On Sun, 28 Sep 2014 17:52:52 +0200 Goswin von Brederlow goswin-...@web.de
wrote:


 And then when force_array only checks up to the number of disks in the
 array it misses half of them. In my case exactly those it should be
 forcing.

This is fixed by upstream patch

commit f81a2b56c4b437f66aaf5582a9c6b7f5ab2103c4
Author: NeilBrown ne...@suse.de
Date:   Tue Oct 22 09:55:04 2013 +1100

Assembe: fix bug in force_array - it wasn't forcing properly.

which is in mdadm-3.3.1.

NeilBrown


pgp7CNgR9NaGZ.pgp
Description: OpenPGP digital signature