diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-22 08:10:35 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-22 08:10:35 -0700 |
commit | 86f9e56d08852961a1b9e062d59b71491d8c793a (patch) | |
tree | 2007eac57a6c720b86283188b4fd5498373f6532 | |
parent | 9c7db5004280767566e91a33445bf93aa479ef02 (diff) | |
parent | 51b86f9a8d1c4bb4e3862ee4b4c5f46072f7520d (diff) | |
download | lwn-86f9e56d08852961a1b9e062d59b71491d8c793a.tar.gz lwn-86f9e56d08852961a1b9e062d59b71491d8c793a.zip |
Merge tag 'for-5.2/dm-fix-1' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
Pull device mapper fix from Mike Snitzer:
"Fix a particularly glaring oversight in a DM core commit from 5.1 that
doesn't properly trim special IOs (e.g. discards) relative to
corresponding target's max_io_len_target_boundary()"
* tag 'for-5.2/dm-fix-1' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
dm: make sure to obey max_io_len_target_boundary
-rw-r--r-- | drivers/md/dm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 1fb1333fefec..997385c1ca54 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1469,7 +1469,7 @@ static unsigned get_num_write_zeroes_bios(struct dm_target *ti) static int __send_changing_extent_only(struct clone_info *ci, struct dm_target *ti, unsigned num_bios) { - unsigned len = ci->sector_count; + unsigned len; /* * Even though the device advertised support for this type of @@ -1480,6 +1480,8 @@ static int __send_changing_extent_only(struct clone_info *ci, struct dm_target * if (!num_bios) return -EOPNOTSUPP; + len = min((sector_t)ci->sector_count, max_io_len_target_boundary(ci->sector, ti)); + __send_duplicate_bios(ci, ti, num_bios, &len); ci->sector += len; |