diff options
author | Mike Christie <mchristi@redhat.com> | 2016-06-02 20:12:37 -0500 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2016-11-20 01:16:55 +0000 |
commit | e48994e504adbe6c4c3ff5da4f791ee0c7bc46e8 (patch) | |
tree | a46b39c616a8781d97b336c1726b398ae1c6afab /include | |
parent | 109e91db05361dcaef6b1715fa6e1c17c809f371 (diff) | |
download | linux-stable-e48994e504adbe6c4c3ff5da4f791ee0c7bc46e8.tar.gz linux-stable-e48994e504adbe6c4c3ff5da4f791ee0c7bc46e8.tar.bz2 linux-stable-e48994e504adbe6c4c3ff5da4f791ee0c7bc46e8.zip |
target: Fix max_unmap_lba_count calc overflow
commit ea263c7fada4af8ec7fe5fcfd6e7d7705a89351b upstream.
max_discard_sectors only 32bits, and some non scsi backend
devices will set this to the max 0xffffffff, so we can end up
overflowing during the max_unmap_lba_count calculation.
This fixes a regression caused by my patch:
commit 8a9ebe717a133ba7bc90b06047f43cc6b8bcb8b3
Author: Mike Christie <mchristi@redhat.com>
Date: Mon Jan 18 14:09:27 2016 -0600
target: Fix WRITE_SAME/DISCARD conversion to linux 512b sectors
which can result in extra discards being sent to due the overflow
causing max_unmap_lba_count to be smaller than what the backing
device can actually support.
Signed-off-by: Mike Christie <mchristi@redhat.com>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/target/target_core_backend.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h index e006e10e08a9..a09a83603c52 100644 --- a/include/target/target_core_backend.h +++ b/include/target/target_core_backend.h @@ -97,6 +97,6 @@ sense_reason_t transport_generic_map_mem_to_cmd(struct se_cmd *, void array_free(void *array, int n); sector_t target_to_linux_sector(struct se_device *dev, sector_t lb); bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib, - struct request_queue *q, int block_size); + struct request_queue *q); #endif /* TARGET_CORE_BACKEND_H */ |