aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-07-27 21:31:48 -0400
committerNeilBrown <neilb@suse.de>2011-07-27 21:31:48 -0400
commitd2eb35acfdccbe2a3622ed6cc441a5482148423b (patch)
tree77600cab29fc9e1fd39d612773086a456fc32d88 /drivers/md/raid1.h
parent9f2f3830789a4c9c1af2d1437d407c43e05136e6 (diff)
md/raid1: avoid reading from known bad blocks.
Now that we have a bad block list, we should not read from those blocks. There are several main parts to this: 1/ read_balance needs to check for bad blocks, and return not only the chosen device, but also how many good blocks are available there. 2/ fix_read_error needs to avoid trying to read from bad blocks. 3/ read submission must be ready to issue multiple reads to different devices as different bad blocks on different devices could mean that a single large read cannot be served by any one device, but can still be served by the array. This requires keeping count of the number of outstanding requests per bio. This count is stored in 'bi_phys_segments' 4/ retrying a read needs to also be ready to submit a smaller read and queue another request for the rest. This does not yet handle bad blocks when reading to perform resync, recovery, or check. 'md_trim_bio' will also be used for RAID10, so put it in md.c and export it. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid1.h')
-rw-r--r--drivers/md/raid1.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/md/raid1.h b/drivers/md/raid1.h
index 3cd18cfda2ad..aa6af37ca01b 100644
--- a/drivers/md/raid1.h
+++ b/drivers/md/raid1.h
@@ -123,6 +123,10 @@ struct r1bio_s {
123#define R1BIO_IsSync 1 123#define R1BIO_IsSync 1
124#define R1BIO_Degraded 2 124#define R1BIO_Degraded 2
125#define R1BIO_BehindIO 3 125#define R1BIO_BehindIO 3
126/* Set ReadError on bios that experience a readerror so that
127 * raid1d knows what to do with them.
128 */
129#define R1BIO_ReadError 4
126/* For write-behind requests, we call bi_end_io when 130/* For write-behind requests, we call bi_end_io when
127 * the last non-write-behind device completes, providing 131 * the last non-write-behind device completes, providing
128 * any write was successful. Otherwise we call when 132 * any write was successful. Otherwise we call when