mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
md/raid10: add a new r10bio flag R10BIO_Returned
The new helper bio_submit_split_bioset() can failed the orginal bio on split errors, prepare to handle this case in raid_end_bio_io(). The flag name is refer to the r1bio flag name. Signed-off-by: Yu Kuai <yukuai3@huawei.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
@@ -322,10 +322,12 @@ static void raid_end_bio_io(struct r10bio *r10_bio)
|
||||
struct bio *bio = r10_bio->master_bio;
|
||||
struct r10conf *conf = r10_bio->mddev->private;
|
||||
|
||||
if (!test_bit(R10BIO_Uptodate, &r10_bio->state))
|
||||
bio->bi_status = BLK_STS_IOERR;
|
||||
if (!test_and_set_bit(R10BIO_Returned, &r10_bio->state)) {
|
||||
if (!test_bit(R10BIO_Uptodate, &r10_bio->state))
|
||||
bio->bi_status = BLK_STS_IOERR;
|
||||
bio_endio(bio);
|
||||
}
|
||||
|
||||
bio_endio(bio);
|
||||
/*
|
||||
* Wake up any possible resync thread that waits for the device
|
||||
* to go idle.
|
||||
|
||||
@@ -165,6 +165,8 @@ enum r10bio_state {
|
||||
* so that raid10d knows what to do with them.
|
||||
*/
|
||||
R10BIO_ReadError,
|
||||
/* For bio_split errors, record that bi_end_io was called. */
|
||||
R10BIO_Returned,
|
||||
/* If a write for this request means we can clear some
|
||||
* known-bad-block records, we set this flag.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user