aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-07-27 21:39:22 -0400
committerNeilBrown <neilb@suse.de>2011-07-27 21:39:22 -0400
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 c5429d12363..8620cb67ae3 100644
--- a/drivers/md/raid5.h
+++ b/drivers/md/raid5.h
@@ -249,6 +249,7 @@ struct stripe_head_state {
249 249
250 struct bio *return_bi; 250 struct bio *return_bi;
251 mdk_rdev_t *blocked_rdev; 251 mdk_rdev_t *blocked_rdev;
252 int handle_bad_blocks;
252}; 253};
253 254
254/* Flags */ 255/* Flags */
@@ -264,14 +265,15 @@ struct stripe_head_state {
264#define R5_ReWrite 9 /* have tried to over-write the readerror */ 265#define R5_ReWrite 9 /* have tried to over-write the readerror */
265 266
266#define R5_Expanded 10 /* This block now has post-expand data */ 267#define R5_Expanded 10 /* This block now has post-expand data */
267#define R5_Wantcompute 11 /* compute_block in progress treat as 268#define R5_Wantcompute 11 /* compute_block in progress treat as
268 * uptodate 269 * uptodate
269 */ 270 */
270#define R5_Wantfill 12 /* dev->toread contains a bio that needs 271#define R5_Wantfill 12 /* dev->toread contains a bio that needs
271 * filling 272 * filling
272 */ 273 */
273#define R5_Wantdrain 13 /* dev->towrite needs to be drained */ 274#define R5_Wantdrain 13 /* dev->towrite needs to be drained */
274#define R5_WantFUA 14 /* Write should be FUA */ 275#define R5_WantFUA 14 /* Write should be FUA */
276#define R5_WriteError 15 /* got a write error - need to record it */
275/* 277/*
276 * Write method 278 * Write method
277 */ 279 */