alistair23-linux/drivers/target
Mike Christie 8a9ebe717a target: Fix WRITE_SAME/DISCARD conversion to linux 512b sectors
In a couple places we are not converting to/from the Linux
block layer 512 bytes sectors.

1.

The request queue values and what we do are a mismatch of
things:

max_discard_sectors - This is in linux block layer 512 byte
sectors. We are just copying this to max_unmap_lba_count.

discard_granularity - This is in bytes. We are converting it
to Linux block layer 512 byte sectors.

discard_alignment - This is in bytes. We are just copying
this over.

The problem is that the core LIO code exports these values in
spc_emulate_evpd_b0 and we use them to test request arguments
in sbc_execute_unmap, but we never convert to the block size
we export to the initiator. If we are not using 512 byte sectors
then we are exporting the wrong values or are checks are off.
And, for the discard_alignment/bytes case we are just plain messed
up.

2.

blkdev_issue_discard's start and number of sector arguments
are supposed to be in linux block layer 512 byte sectors. We are
currently passing in the values we get from the initiator which
might be based on some other sector size.

There is a similar problem in iblock_execute_write_same where
the bio functions want values in 512 byte sectors but we are
passing in what we got from the initiator.

Signed-off-by: Mike Christie <mchristi@redhat.com>
Cc: stable@vger.kernel.org # 3.10+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2016-01-29 19:29:34 -08:00
..
iscsi Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2016-01-20 17:20:53 -08:00
loopback tcm_loop: Show address of tpg in configfs 2015-11-29 03:01:45 -08:00
sbp sbp-target: Remove a superfluous forward declaration 2016-01-06 13:39:53 -08:00
tcm_fc tcm_fc: Convert acl lookup to modern get_initiator_node_acl usage 2016-01-12 23:17:51 -08:00
Kconfig target: Put TCMU under a new config option 2015-04-19 22:41:12 -07:00
Makefile target: Put TCMU under a new config option 2015-04-19 22:41:12 -07:00
target_core_alua.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2015-07-04 14:13:43 -07:00
target_core_alua.h target: Subsume se_port + t10_alua_tg_pt_gp_member into se_lun 2015-06-01 00:26:38 -07:00
target_core_configfs.c target: Fix a memory leak in target_dev_lba_map_store() 2016-01-07 13:57:55 -08:00
target_core_device.c target: Fix WRITE_SAME/DISCARD conversion to linux 512b sectors 2016-01-29 19:29:34 -08:00
target_core_fabric_configfs.c target: use per-attribute show and store methods 2015-10-13 22:17:49 -07:00
target_core_fabric_lib.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2015-07-04 14:13:43 -07:00
target_core_file.c target: Fix WRITE_SAME/DISCARD conversion to linux 512b sectors 2016-01-29 19:29:34 -08:00
target_core_file.h target/file: Remove fd_prot bounce buffer 2015-05-30 22:41:42 -07:00
target_core_hba.c target: Fix target_sense_desc_format NULL pointer dereference 2015-09-24 23:17:23 -07:00
target_core_iblock.c target: Fix WRITE_SAME/DISCARD conversion to linux 512b sectors 2016-01-29 19:29:34 -08:00
target_core_iblock.h target: kill struct se_subsystem_dev 2012-11-06 20:55:43 -08:00
target_core_internal.h target: use per-attribute show and store methods 2015-10-13 22:17:49 -07:00
target_core_pr.c target: Fix spelling + remove set-but-not-used variables 2016-01-06 13:38:37 -08:00
target_core_pr.h target: use 64-bit LUNs 2015-06-15 23:26:01 -07:00
target_core_pscsi.c block: add a bi_error field to struct bio 2015-07-29 08:55:15 -06:00
target_core_pscsi.h SCSI misc on 20150622 2015-06-23 15:55:44 -07:00
target_core_rd.c Merge branch 'for-4.3/sg' of git://git.kernel.dk/linux-block 2015-09-02 13:22:38 -07:00
target_core_rd.h target/rd: Add support for protection SGL setup + release 2014-01-19 02:22:05 +00:00
target_core_sbc.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2016-01-20 17:20:53 -08:00
target_core_spc.c target/sbc: Add LBPRZ attribute + control CDB emulation 2016-01-06 13:39:55 -08:00
target_core_stat.c target/stat: print full t10_wwn.model buffer 2015-11-28 21:23:13 -08:00
target_core_tmr.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2016-01-20 17:20:53 -08:00
target_core_tpg.c target: Obtain se_node_acl->acl_kref during get_initiator_node_acl 2016-01-20 01:34:15 -08:00
target_core_transport.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2016-01-20 17:20:53 -08:00
target_core_ua.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2015-07-04 14:13:43 -07:00
target_core_ua.h target: Send UA when changing LUN inventory 2015-06-23 00:43:02 -07:00
target_core_user.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2016-01-20 17:20:53 -08:00
target_core_xcopy.c target: Attach EXTENDED_COPY local I/O descriptors to xcopy_pt_sess 2015-09-11 00:32:26 -07:00
target_core_xcopy.h target: Add support for EXTENDED_COPY copy offload emulation 2013-09-10 16:48:43 -07:00