Skip to content

Commit b25b8f4

Browse files
Ming LeiMike Snitzer
authored andcommitted
dm raid: fix false positive for requeue needed during reshape
An empty flush doesn't have a payload, so it should never be looked at when considering to possibly requeue a bio for the case when a reshape is in progress. Fixes: 9dbd1aa ("dm raid: add reshaping support to the target") Reported-by: Patrick Plenefisch <[email protected]> Signed-off-by: Ming Lei <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
1 parent f30e5ed commit b25b8f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/md/dm-raid.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3329,14 +3329,14 @@ static int raid_map(struct dm_target *ti, struct bio *bio)
33293329
struct mddev *mddev = &rs->md;
33303330

33313331
/*
3332-
* If we're reshaping to add disk(s)), ti->len and
3332+
* If we're reshaping to add disk(s), ti->len and
33333333
* mddev->array_sectors will differ during the process
33343334
* (ti->len > mddev->array_sectors), so we have to requeue
33353335
* bios with addresses > mddev->array_sectors here or
33363336
* there will occur accesses past EOD of the component
33373337
* data images thus erroring the raid set.
33383338
*/
3339-
if (unlikely(bio_end_sector(bio) > mddev->array_sectors))
3339+
if (unlikely(bio_has_data(bio) && bio_end_sector(bio) > mddev->array_sectors))
33403340
return DM_MAPIO_REQUEUE;
33413341

33423342
md_handle_request(mddev, bio);

0 commit comments

Comments
 (0)