Commit b25b8f4b authored by Ming Lei's avatar Ming Lei Committed by Mike Snitzer

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: 9dbd1aa3 ("dm raid: add reshaping support to the target")
Reported-by: default avatarPatrick Plenefisch <simonpatp@gmail.com>
Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
parent f30e5ed1
......@@ -3329,14 +3329,14 @@ static int raid_map(struct dm_target *ti, struct bio *bio)
struct mddev *mddev = &rs->md;
/*
* If we're reshaping to add disk(s)), ti->len and
* If we're reshaping to add disk(s), ti->len and
* mddev->array_sectors will differ during the process
* (ti->len > mddev->array_sectors), so we have to requeue
* bios with addresses > mddev->array_sectors here or
* there will occur accesses past EOD of the component
* data images thus erroring the raid set.
*/
if (unlikely(bio_end_sector(bio) > mddev->array_sectors))
if (unlikely(bio_has_data(bio) && bio_end_sector(bio) > mddev->array_sectors))
return DM_MAPIO_REQUEUE;
md_handle_request(mddev, bio);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment