summaryrefslogtreecommitdiff
path: root/drivers/md/raid5.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-07-28 11:39:22 +1000
committerNeilBrown <neilb@suse.de>2011-07-28 11:39:22 +1000
commitbc2607f393bd4fb844c1886a02af929ca0372056 (patch)
tree45c7f9c538b5e196e389454286771f3beb8628ba /drivers/md/raid5.h
parent7f0da59bdc2f65795a57009d78f7753d3aea1de3 (diff)
md/raid5: write errors should be recorded as bad blocks if possible.
When a write error is detected, don't mark the device as failed immediately but rather record the fact for handle_stripe to deal with. Handle_stripe then attempts to record a bad block. Only if that fails does the device get marked as faulty. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid5.h')
-rw-r--r--drivers/md/raid5.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h
index c5429d123636..8620cb67ae39 100644
--- a/drivers/md/raid5.h
+++ b/drivers/md/raid5.h
@@ -249,6 +249,7 @@ struct stripe_head_state {
struct bio *return_bi;
mdk_rdev_t *blocked_rdev;
+ int handle_bad_blocks;
};
/* Flags */
@@ -264,14 +265,15 @@ struct stripe_head_state {
#define R5_ReWrite 9 /* have tried to over-write the readerror */
#define R5_Expanded 10 /* This block now has post-expand data */
-#define R5_Wantcompute 11 /* compute_block in progress treat as
- * uptodate
- */
-#define R5_Wantfill 12 /* dev->toread contains a bio that needs
- * filling
- */
-#define R5_Wantdrain 13 /* dev->towrite needs to be drained */
-#define R5_WantFUA 14 /* Write should be FUA */
+#define R5_Wantcompute 11 /* compute_block in progress treat as
+ * uptodate
+ */
+#define R5_Wantfill 12 /* dev->toread contains a bio that needs
+ * filling
+ */
+#define R5_Wantdrain 13 /* dev->towrite needs to be drained */
+#define R5_WantFUA 14 /* Write should be FUA */
+#define R5_WriteError 15 /* got a write error - need to record it */
/*
* Write method
*/