aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/dm.c4
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)
1469static int __send_changing_extent_only(struct clone_info *ci, struct dm_target *ti, 1469static int __send_changing_extent_only(struct clone_info *ci, struct dm_target *ti,
1470 unsigned num_bios) 1470 unsigned num_bios)
1471{ 1471{
1472 unsigned len = ci->sector_count; 1472 unsigned len;
1473 1473
1474 /* 1474 /*
1475 * Even though the device advertised support for this type of 1475 * 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 *
1480 if (!num_bios) 1480 if (!num_bios)
1481 return -EOPNOTSUPP; 1481 return -EOPNOTSUPP;
1482 1482
1483 len = min((sector_t)ci->sector_count, max_io_len_target_boundary(ci->sector, ti));
1484
1483 __send_duplicate_bios(ci, ti, num_bios, &len); 1485 __send_duplicate_bios(ci, ti, num_bios, &len);
1484 1486
1485 ci->sector += len; 1487 ci->sector += len;