linux/include/target
Mike Christie e48994e504 target: Fix max_unmap_lba_count calc overflow
commit ea263c7fad 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 8a9ebe717a
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>
History 2016-11-20 01:16:55 +00:00
..
iscsi Target/iscsi: Fix sendtargets response pdu for iser transport 2014-06-11 11:52:39 -07:00
configfs_macros.h doc: fix broken references 2011-09-27 18:08:04 +02:00
target_core_backend.h target: Fix max_unmap_lba_count calc overflow 2016-11-20 01:16:55 +00:00
target_core_base.h target: Fix remote-port TMR ABORT + se_cmd fabric stop 2016-03-24 10:00:49 +00:00
target_core_configfs.h target: Remove TF_CIT_TMPL macro 2013-10-16 13:35:02 -07:00
target_core_fabric.h target: Pass in transport supported PI at session initialization 2014-04-07 01:48:54 -07:00
target_core_fabric_configfs.h target: Add se_portal_group->tpg_auth_group 2013-07-03 19:44:31 -07:00