Linus,
The following patch improves md's handling of error conditions.
When a drive fails, it is quite possible for several requests to be
outstanding, and so md_error may well be called several times, one for
each request.
This patch causes md_error to only do the full processing the first
time. Subsequent times it notices that the drive is already "failed"
and it gives up.
We should really do a "test-and-set" on the "faulty" flag, but that
is awkward at the moment, and the patch below will fail to the current
behaviour, so it is still a net improvement.
I plan to tidy up the various status bits shortly, removing some
duplication and checking SMP safety. (look at raid5_error if you
wonder what I mean by "duplication").
NeilBrown
--- ./drivers/md/md.c 2001/07/01 22:58:07 1.2
+++ ./drivers/md/md.c 2001/07/01 22:58:53 1.3
@@ -483,14 +483,17 @@
}
}
-static void mark_rdev_faulty (mdk_rdev_t * rdev)
+static inline int mark_rdev_faulty (mdk_rdev_t * rdev)
{
if (!rdev) {
MD_BUG();
- return;
+ return 0;
}
+ if (rdev->faulty)
+ return 0;
free_disk_sb(rdev);
rdev->faulty = 1;
+ return 1;
}
static int read_disk_sb (mdk_rdev_t * rdev)
@@ -2932,7 +2935,8 @@
return 0;
}
rrdev = find_rdev(mddev, rdev);
- mark_rdev_faulty(rrdev);
+ if (!mark_rdev_faulty(rrdev))
+ return 0;
/*
* if recovery was running, stop it now.
*/
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to [EMAIL PROTECTED]