summaryrefslogtreecommitdiff
path: root/drivers/target/target_core_hba.c
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2015-07-16 10:28:05 +0300
committerNicholas Bellinger <nab@linux-iscsi.org>2015-07-23 22:54:21 -0700
commit4e4937e8aefde8d49340e803ebbedcdf4b43e5f0 (patch)
treeea9153817ac32402c68db2eb7b9b48d4a5cbcd6a /drivers/target/target_core_hba.c
parentf5a8b3a796db01b639435515b3adc003b9f27387 (diff)
target: Return descriptor format sense data in case the LU spans 64bit sectors
In case a LU spans 64bit sectors, fixed size sense data information field is only 32 bits which means the sector information will be truncated. Thus, if the LU spans 64bit sectors, use descriptor format sense data to correctly report sector information. Reported-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_hba.c')
-rw-r--r--drivers/target/target_core_hba.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/target/target_core_hba.c b/drivers/target/target_core_hba.c
index 62ea4e8e70a8..d746a3a4a623 100644
--- a/drivers/target/target_core_hba.c
+++ b/drivers/target/target_core_hba.c
@@ -176,3 +176,8 @@ core_delete_hba(struct se_hba *hba)
kfree(hba);
return 0;
}
+
+bool target_sense_desc_format(struct se_device *dev)
+{
+ return dev->transport->get_blocks(dev) > U32_MAX;
+}