* Question about recovery via mdadm
@ 2003-02-13 15:43 Cress, Andrew R
2003-02-13 23:15 ` Neil Brown
0 siblings, 1 reply; 7+ messages in thread
From: Cress, Andrew R @ 2003-02-13 15:43 UTC (permalink / raw)
To: 'Neil Brown'; +Cc: linux-raid
Neil,
I've seen this issue several times, and it seems most acute with the RedHat
8.0 kernel (2.4.18-14).
Situation:
I did a hotswap of sda, with: mdadm -f, raidhotremove, then raidhotadd.
The md kernel messages indicate that the removal, hotadd, and bind occurred,
then it has the raid printout of the status before the recovery, but never
starts the recovery/resync. Sometimes it will explicitly say that it is
hot-adding the disk as a spare, sometimes not.
# cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 sda6[2] sdb6[1]
289024 blocks [2/1] [U_]
md1 : active raid1 sda2[2] sdb2[1]
64192 blocks [2/1] [U_]
md0 : active raid1 sda5[2] sdb5[1]
5293312 blocks [2/1] [U_]
unused devices: <none>
#
The superblock mdadm --examine shows that nd=2, wd=2, but 1 disk is active
and the other (sda) is a spare.
Question:
Solving why I got into this is another issue, but:
Is there any way, once I'm in this predicament, to force a recovery to the
spare, from userland (via mdadm)?
Andy
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: Question about recovery via mdadm
2003-02-13 15:43 Question about recovery via mdadm Cress, Andrew R
@ 2003-02-13 23:15 ` Neil Brown
2003-02-16 10:32 ` James Ralston
0 siblings, 1 reply; 7+ messages in thread
From: Neil Brown @ 2003-02-13 23:15 UTC (permalink / raw)
To: Cress, Andrew R; +Cc: linux-raid
On Thursday February 13, andrew.r.cress@intel.com wrote:
>
> Question:
> Solving why I got into this is another issue, but:
> Is there any way, once I'm in this predicament, to force a recovery to the
> spare, from userland (via mdadm)?
No.
Reconstrution should start automatically. There is no mechanism to
start it from user-space.
You could try to hot-remove and hot-add again, but if it didn't work
the first time it is unlikely to work the second time.
I would appear to be a kernel bug. Do you know if redhat:2.4.18-14
contains any patches particular to md?
Are there any kernel messages? An Oops or something?
NeilBrown
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Question about recovery via mdadm
2003-02-13 23:15 ` Neil Brown
@ 2003-02-16 10:32 ` James Ralston
2003-02-16 22:09 ` Neil Brown
0 siblings, 1 reply; 7+ messages in thread
From: James Ralston @ 2003-02-16 10:32 UTC (permalink / raw)
To: Neil Brown, Cress, Andrew R; +Cc: linux-raid
On 2003-02-14 at 10:15:07+1100 Neil Brown <neilb@cse.unsw.edu.au> wrote:
> On Thursday February 13, andrew.r.cress@intel.com wrote:
>
> > Solving why I got into this is another issue, but: Is there any
> > way, once I'm in this predicament, to force a recovery to the
> > spare, from userland (via mdadm)?
>
> No. Reconstrution should start automatically. There is no
> mechanism to start it from user-space. You could try to hot-remove
> and hot-add again, but if it didn't work the first time it is
> unlikely to work the second time.
>
> It would appear to be a kernel bug. Are there any kernel messages?
> An Oops or something?
I'll bet that if Andrew checks his syslog carefully, he'll find that
the mdrecovery process generated a kernel Oops:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=82815
If this is what happened, then simply rebooting the system should
cause the reconstruction to start.
> Do you know if redhat:2.4.18-14 contains any patches particular to
> md?
I doubt that's the problem, as I tried backporting the vanilla md
driver from 2.4.21-pre3 into Red Hat's kernel-2.4.18-19.8.0, and I
could still Oops it.
IMHO, the two most likely explanations are:
1. There's a bug in the md driver somewhere.
2. Red Hat has tweaked/changed something in the kernel that the
md driver is relying on, and as a result, what the md driver
is doing causes an Oops.
Neil, if you want to try to track this down, I'll be happy to help in
any way I can. (I don't have enough kernel hacking experience to
track this down myself, alas.)
Regards,
--
James Ralston, Information Technology
Software Engineering Institute
Carnegie Mellon University, Pittsburgh, PA, USA
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: Question about recovery via mdadm
2003-02-16 10:32 ` James Ralston
@ 2003-02-16 22:09 ` Neil Brown
2003-02-17 1:05 ` James Ralston
0 siblings, 1 reply; 7+ messages in thread
From: Neil Brown @ 2003-02-16 22:09 UTC (permalink / raw)
To: James Ralston; +Cc: Cress, Andrew R, linux-raid
On Sunday February 16, qralston+ml.linux-raid@andrew.cmu.edu wrote:
> On 2003-02-14 at 10:15:07+1100 Neil Brown <neilb@cse.unsw.edu.au> wrote:
>
> > On Thursday February 13, andrew.r.cress@intel.com wrote:
> >
> > > Solving why I got into this is another issue, but: Is there any
> > > way, once I'm in this predicament, to force a recovery to the
> > > spare, from userland (via mdadm)?
> >
> > No. Reconstrution should start automatically. There is no
> > mechanism to start it from user-space. You could try to hot-remove
> > and hot-add again, but if it didn't work the first time it is
> > unlikely to work the second time.
> >
> > It would appear to be a kernel bug. Are there any kernel messages?
> > An Oops or something?
>
> I'll bet that if Andrew checks his syslog carefully, he'll find that
> the mdrecovery process generated a kernel Oops:
>
> https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=82815
Thanks...
I think that bug should be fixed by the follow patch which has been
submitted and accepted and should be in 2.4.21.
NeilBrown
-----------------------------------------
Avoid races by never releasing rdev->sb for faulty devices.
There are races relating to the superblocks being written out
just as a device has failed, and the rdev->sb getting freeing while
it is being written out. This patch tries to avoid one of the
races by testing the faulty bit in the superblock (which gets set
early) as well as rdev->faulty (which gets set late), and does not
free rdev->sb until the rdev is fully removed, thus making the races
less critical.
----------- Diffstat output ------------
./drivers/md/md.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff ./drivers/md/md.c~current~ ./drivers/md/md.c
--- ./drivers/md/md.c~current~ 2003-01-03 10:25:44.000000000 +1100
+++ ./drivers/md/md.c 2003-01-03 10:25:43.000000000 +1100
@@ -1048,7 +1048,11 @@ repeat:
printk("(skipping faulty ");
if (rdev->alias_device)
printk("(skipping alias ");
-
+ if (disk_faulty(&rdev->sb->this_disk)) {
+ printk("(skipping new-faulty %s )\n",
+ partition_name(rdev->dev));
+ continue;
+ }
printk("%s ", partition_name(rdev->dev));
if (!rdev->faulty && !rdev->alias_device) {
printk("[events: %08lx]",
@@ -1075,7 +1079,6 @@ repeat:
* - the device is nonexistent (zero size)
* - the device has no valid superblock
*
- * a faulty rdev _never_ has rdev->sb set.
*/
static int md_import_device(kdev_t newdev, int on_disk)
{
@@ -1147,8 +1150,6 @@ static int md_import_device(kdev_t newde
md_list_add(&rdev->all, &all_raid_disks);
MD_INIT_LIST_HEAD(&rdev->pending);
- if (rdev->faulty && rdev->sb)
- free_disk_sb(rdev);
return 0;
abort_free:
@@ -3062,7 +3063,6 @@ int md_error(mddev_t *mddev, kdev_t rdev
return 0;
if (!mddev->pers->error_handler
|| mddev->pers->error_handler(mddev,rdev) <= 0) {
- free_disk_sb(rrdev);
rrdev->faulty = 1;
} else
return 1;
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: Question about recovery via mdadm
2003-02-16 22:09 ` Neil Brown
@ 2003-02-17 1:05 ` James Ralston
2003-02-18 5:45 ` Neil Brown
0 siblings, 1 reply; 7+ messages in thread
From: James Ralston @ 2003-02-17 1:05 UTC (permalink / raw)
To: Neil Brown; +Cc: Cress, Andrew R, linux-raid
On 2003-02-17 at 09:09:53+1100 Neil Brown <neilb@cse.unsw.edu.au> wrote:
> > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=82815
>
> I think that bug should be fixed by the follow patch which has been
> submitted and accepted and should be in 2.4.21.
I already tried backporting the md driver from 2.4.21-pre3 (which
contains the patch you included). Unfortunately, not only does it not
fix the problem, but it makes it worse: with the patch applied, after
the Oops occurs, touching the md device in any way hangs. This
includes the "md: stopping all md devices" which occurs at shutdown,
so as a result, at shutdown, the entire machine hangs, and you have to
go physically reset or power cycle the machine.
I've appended the Oops I generated using the md driver from
2.4.21-pre3 in Red Hat's kernel-2.4.18-19.8.0. This is how I produced
it:
$ mdadm --create /dev/md0 --verbose --level=mirror --raid-devices=2 /dev/sdb1 /dev/sdc1
<wait for sync>
$ mdadm /dev/md0 -f /dev/sdc1 -r /dev/sdc1 -a /dev/sdc1
<wait for sync>
$ mdadm /dev/md0 -f /dev/sdb1 -r /dev/sdb1 -a /dev/sdb1
<mdrecovery generates Oops>
As I said before, I'm at a loss to figure out where the bug is, but if
you have any further things to try, I'd be happy to give them a
whirl...
Regards,
James
Feb 16 19:40:55 kernel: md: sdc1 [events: 0000000b]<6>(write) sdc1's sb offset: 72192
Feb 16 19:40:55 kernel: md: <1>Unable to handle kernel NULL pointer dereference at virtual address 00000f90
Feb 16 19:40:55 kernel: printing eip:
Feb 16 19:40:55 kernel: c01e0f3a
Feb 16 19:40:55 kernel: *pde = 00000000
Feb 16 19:40:55 kernel: Oops: 0000
Feb 16 19:40:55 kernel: tg3 iptable_filter ip_tables ide-cd cdrom raid1 mousedev keybdev hid input usb-ohci usbcore ext3 jbd aic7xxx sd_mod scsi_mod
Feb 16 19:40:55 kernel: CPU: 0
Feb 16 19:40:55 kernel: EIP: 0010:[<c01e0f3a>] Not tainted
Feb 16 19:40:55 kernel: EFLAGS: 00010202
Feb 16 19:40:55 kernel:
Feb 16 19:40:55 kernel: EIP is at md_update_sb [kernel] 0xda (2.4.18-19.8.0.ralston.0)
Feb 16 19:40:55 kernel: eax: 00000f80 ebx: dd31ace0 ecx: 00000001 edx: 00000001
Feb 16 19:40:55 kernel: esi: dd31ace0 edi: c257bb74 ebp: c257bb60 esp: daf8df58
Feb 16 19:40:55 kernel: ds: 0018 es: 0018 ss: 0018
Feb 16 19:40:55 kernel: Process raid1d (pid: 755, stackpage=daf8d000)
Feb 16 19:40:55 kernel: Stack: c026ab7e 0000000a dfd74f80 00000064 00000000 daf8c000 00000001 db63a7a8
Feb 16 19:40:55 kernel: c257bb60 e089ebe2 c257bb60 daf8dfac dffd55a0 00000000 dfd8c014 daf8dfa0
Feb 16 19:40:55 kernel: c011fd0a daf8c000 daf8c000 db63a7a0 db63a7a8 daf8dfd0 c01e4201 dd26a000
Feb 16 19:40:55 kernel: Call Trace: [<e089ebe2>] raid1d [raid1] 0x332 (0xdaf8df7c))
Feb 16 19:40:55 kernel: [<c011fd0a>] __run_task_queue [kernel] 0x5a (0xdaf8df98))
Feb 16 19:40:55 kernel: [<c01e4201>] md_thread [kernel] 0xf1 (0xdaf8dfb0))
Feb 16 19:40:55 kernel: [<e08a029c>] .rodata.str1.1 [raid1] 0x75 (0xdaf8dfb8))
Feb 16 19:40:55 kernel: [<c010745e>] kernel_thread [kernel] 0x2e (0xdaf8dff0))
Feb 16 19:40:55 kernel: [<c01e4110>] md_thread [kernel] 0x0 (0xdaf8dff8))
Feb 16 19:40:55 kernel:
Feb 16 19:40:55 kernel:
Feb 16 19:40:55 kernel: Code: f6 40 10 01 74 60 0f b7 43 18 89 04 24 e8 b4 e8 ff ff 89 44
Feb 16 19:40:55 kernel: <6>md: trying to hot-add sdb1 to md0 ...
Feb 16 19:40:55 kernel: md: bind<sdb1,2>
Feb 16 19:40:55 kernel: RAID1 conf printout:
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: Question about recovery via mdadm
2003-02-17 1:05 ` James Ralston
@ 2003-02-18 5:45 ` Neil Brown
0 siblings, 0 replies; 7+ messages in thread
From: Neil Brown @ 2003-02-18 5:45 UTC (permalink / raw)
To: James Ralston; +Cc: Cress, Andrew R, linux-raid
On Sunday February 16, qralston+ml.linux-raid@andrew.cmu.edu wrote:
> On 2003-02-17 at 09:09:53+1100 Neil Brown <neilb@cse.unsw.edu.au> wrote:
>
> > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=82815
> >
> > I think that bug should be fixed by the follow patch which has been
> > submitted and accepted and should be in 2.4.21.
>
> I already tried backporting the md driver from 2.4.21-pre3 (which
> contains the patch you included). Unfortunately, not only does it not
> fix the problem, but it makes it worse: with the patch applied, after
> the Oops occurs, touching the md device in any way hangs. This
> includes the "md: stopping all md devices" which occurs at shutdown,
> so as a result, at shutdown, the entire machine hangs, and you have to
> go physically reset or power cycle the machine.
>
> I've appended the Oops I generated using the md driver from
> 2.4.21-pre3 in Red Hat's kernel-2.4.18-19.8.0. This is how I produced
> it:
>
> $ mdadm --create /dev/md0 --verbose --level=mirror --raid-devices=2 /dev/sdb1 /dev/sdc1
> <wait for sync>
> $ mdadm /dev/md0 -f /dev/sdc1 -r /dev/sdc1 -a /dev/sdc1
> <wait for sync>
> $ mdadm /dev/md0 -f /dev/sdb1 -r /dev/sdb1 -a /dev/sdb1
> <mdrecovery generates Oops>
>
> As I said before, I'm at a loss to figure out where the bug is, but if
> you have any further things to try, I'd be happy to give them a
> whirl...
Hmmm... you can probasbly alleviate the symptoms with:
diff ./drivers/md/md.c~current~ ./drivers/md/md.c
--- ./drivers/md/md.c~current~ 2003-02-17 13:24:11.000000000 +1100
+++ ./drivers/md/md.c 2003-02-17 13:24:59.000000000 +1100
@@ -1048,7 +1048,7 @@ repeat:
printk("(skipping faulty ");
if (rdev->alias_device)
printk("(skipping alias ");
- if (disk_faulty(&rdev->sb->this_disk)) {
+ if (!rdev->faulty && disk_faulty(&rdev->sb->this_disk)) {
printk("(skipping new-faulty %s )\n",
partition_name(rdev->dev));
continue;
but the real problem is a lack of locking. A lot of work went into
2.5 to get the locking right in the md driver and it resulted in a
substantial shake-up of the code. I do have a patch that does better
locking for 2.4, but it is rather ugly.... maybe I should revisit it.
NeilBrown
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: Question about recovery via mdadm
@ 2003-02-17 15:59 Cress, Andrew R
0 siblings, 0 replies; 7+ messages in thread
From: Cress, Andrew R @ 2003-02-17 15:59 UTC (permalink / raw)
To: 'Neil Brown', James Ralston; +Cc: linux-raid
The bug I'm experiencing does not produce a kernel oops, just a dump of the
RAID state output.
I'm guessing that it would not happen with the 2.5.x changes to md that
consolidated the superblock counters in one place.
The system does start a recovery if it is rebooted, but my use case is to
avoid reboots at all cost.
Anyway, I'll go back and get the kernel messages for this problem to pursue
it.
Andy
-----Original Message-----
From: Neil Brown [mailto:neilb@cse.unsw.edu.au]
Sent: Sunday, February 16, 2003 5:10 PM
To: James Ralston
Cc: Cress, Andrew R; linux-raid@vger.kernel.org
Subject: Re: Question about recovery via mdadm
On Sunday February 16, qralston+ml.linux-raid@andrew.cmu.edu wrote:
> On 2003-02-14 at 10:15:07+1100 Neil Brown <neilb@cse.unsw.edu.au> wrote:
>
> > On Thursday February 13, andrew.r.cress@intel.com wrote:
> >
> > > Solving why I got into this is another issue, but: Is there any
> > > way, once I'm in this predicament, to force a recovery to the
> > > spare, from userland (via mdadm)?
> >
> > No. Reconstrution should start automatically. There is no
> > mechanism to start it from user-space. You could try to hot-remove
> > and hot-add again, but if it didn't work the first time it is
> > unlikely to work the second time.
> >
> > It would appear to be a kernel bug. Are there any kernel messages?
> > An Oops or something?
>
> I'll bet that if Andrew checks his syslog carefully, he'll find that
> the mdrecovery process generated a kernel Oops:
>
> https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=82815
Thanks...
I think that bug should be fixed by the follow patch which has been
submitted and accepted and should be in 2.4.21.
NeilBrown
-----------------------------------------
Avoid races by never releasing rdev->sb for faulty devices.
There are races relating to the superblocks being written out
just as a device has failed, and the rdev->sb getting freeing while
it is being written out. This patch tries to avoid one of the
races by testing the faulty bit in the superblock (which gets set
early) as well as rdev->faulty (which gets set late), and does not
free rdev->sb until the rdev is fully removed, thus making the races
less critical.
----------- Diffstat output ------------
./drivers/md/md.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff ./drivers/md/md.c~current~ ./drivers/md/md.c
--- ./drivers/md/md.c~current~ 2003-01-03 10:25:44.000000000 +1100
+++ ./drivers/md/md.c 2003-01-03 10:25:43.000000000 +1100
@@ -1048,7 +1048,11 @@ repeat:
printk("(skipping faulty ");
if (rdev->alias_device)
printk("(skipping alias ");
-
+ if (disk_faulty(&rdev->sb->this_disk)) {
+ printk("(skipping new-faulty %s )\n",
+ partition_name(rdev->dev));
+ continue;
+ }
printk("%s ", partition_name(rdev->dev));
if (!rdev->faulty && !rdev->alias_device) {
printk("[events: %08lx]",
@@ -1075,7 +1079,6 @@ repeat:
* - the device is nonexistent (zero size)
* - the device has no valid superblock
*
- * a faulty rdev _never_ has rdev->sb set.
*/
static int md_import_device(kdev_t newdev, int on_disk)
{
@@ -1147,8 +1150,6 @@ static int md_import_device(kdev_t newde
md_list_add(&rdev->all, &all_raid_disks);
MD_INIT_LIST_HEAD(&rdev->pending);
- if (rdev->faulty && rdev->sb)
- free_disk_sb(rdev);
return 0;
abort_free:
@@ -3062,7 +3063,6 @@ int md_error(mddev_t *mddev, kdev_t rdev
return 0;
if (!mddev->pers->error_handler
|| mddev->pers->error_handler(mddev,rdev) <= 0) {
- free_disk_sb(rrdev);
rrdev->faulty = 1;
} else
return 1;
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2003-02-18 5:45 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-13 15:43 Question about recovery via mdadm Cress, Andrew R
2003-02-13 23:15 ` Neil Brown
2003-02-16 10:32 ` James Ralston
2003-02-16 22:09 ` Neil Brown
2003-02-17 1:05 ` James Ralston
2003-02-18 5:45 ` Neil Brown
-- strict thread matches above, loose matches on Subject: below --
2003-02-17 15:59 Cress, Andrew R
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox