diff options
author | Ming Lei <ming.lei@redhat.com> | 2024-03-11 13:42:55 -0400 |
---|---|---|
committer | Sasha Levin <sashal@kernel.org> | 2024-03-26 18:20:43 -0400 |
commit | 2b50b4f0d40dee8181148a39ca5bb5079a35777c (patch) | |
tree | 58279ddc327896e38ba846feeef27ab3394e078a | |
parent | b605c3831fb47731a55a1e50e919c45c308f96e0 (diff) | |
download | linux-2b50b4f0d40dee8181148a39ca5bb5079a35777c.tar.gz linux-2b50b4f0d40dee8181148a39ca5bb5079a35777c.tar.bz2 linux-2b50b4f0d40dee8181148a39ca5bb5079a35777c.zip |
dm raid: fix false positive for requeue needed during reshape
[ Upstream commit b25b8f4b8ecef0f48c05f0c3572daeabefe16526 ]
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: 9dbd1aa3a81c ("dm raid: add reshaping support to the target")
Reported-by: Patrick Plenefisch <simonpatp@gmail.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/md/dm-raid.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index 4b7528dc2fd0..7fbce214e00f 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c @@ -3325,14 +3325,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); |