diff options
author | NeilBrown <neilb@suse.de> | 2011-07-28 11:31:48 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-07-28 11:31:48 +1000 |
commit | d2eb35acfdccbe2a3622ed6cc441a5482148423b (patch) | |
tree | 77600cab29fc9e1fd39d612773086a456fc32d88 /drivers/md/raid1.h | |
parent | 9f2f3830789a4c9c1af2d1437d407c43e05136e6 (diff) | |
download | lwn-d2eb35acfdccbe2a3622ed6cc441a5482148423b.tar.gz lwn-d2eb35acfdccbe2a3622ed6cc441a5482148423b.zip |
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.h | 4 |
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 { #define R1BIO_IsSync 1 #define R1BIO_Degraded 2 #define R1BIO_BehindIO 3 +/* Set ReadError on bios that experience a readerror so that + * raid1d knows what to do with them. + */ +#define R1BIO_ReadError 4 /* For write-behind requests, we call bi_end_io when * the last non-write-behind device completes, providing * any write was successful. Otherwise we call when |