Commit deeeab30 authored by Yu Kuai's avatar Yu Kuai Committed by Jens Axboe
Browse files

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: default avatarYu Kuai <yukuai3@huawei.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent a6fcc160
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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_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);
	}

	/*
	 * Wake up any possible resync thread that waits for the device
	 * to go idle.
+2 −0
Original line number Diff line number Diff line
@@ -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.
 */