summaryrefslogtreecommitdiffstats
path: root/include/scsi/scsi_devinfo.h
diff options
context:
space:
mode:
authorMartin K. Petersen <martin.petersen@oracle.com>2017-09-27 21:35:12 -0400
committerMartin K. Petersen <martin.petersen@oracle.com>2017-10-02 22:16:18 -0400
commit28a0bc4120d38a394499382ba21d6965a67a3703 (patch)
treed9cae3be601b655420b9c765841e310d102a51d8 /include/scsi/scsi_devinfo.h
parentd0b7a9095c0730b92a0a2eecaba2e6b77ed87339 (diff)
downloadlinux-28a0bc4120d38a394499382ba21d6965a67a3703.tar.bz2
scsi: sd: Implement blacklist option for WRITE SAME w/ UNMAP
SBC-4 states: "A MAXIMUM UNMAP LBA COUNT field set to a non-zero value indicates the maximum number of LBAs that may be unmapped by an UNMAP command" "A MAXIMUM WRITE SAME LENGTH field set to a non-zero value indicates the maximum number of contiguous logical blocks that the device server allows to be unmapped or written in a single WRITE SAME command." Despite the spec being clear on the topic, some devices incorrectly expect WRITE SAME commands with the UNMAP bit set to be limited to the value reported in MAXIMUM UNMAP LBA COUNT in the Block Limits VPD. Implement a blacklist option that can be used to accommodate devices with this behavior. Cc: <stable@vger.kernel.org> Reported-by: Bill Kuzeja <William.Kuzeja@stratus.com> Reported-by: Ewan D. Milne <emilne@redhat.com> Reviewed-by: Ewan D. Milne <emilne@redhat.com> Tested-by: Laurence Oberman <loberman@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/scsi/scsi_devinfo.h')
-rw-r--r--include/scsi/scsi_devinfo.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/scsi/scsi_devinfo.h b/include/scsi/scsi_devinfo.h
index 9592570e092a..36b03013d629 100644
--- a/include/scsi/scsi_devinfo.h
+++ b/include/scsi/scsi_devinfo.h
@@ -29,5 +29,6 @@
#define BLIST_TRY_VPD_PAGES 0x10000000 /* Attempt to read VPD pages */
#define BLIST_NO_RSOC 0x20000000 /* don't try to issue RSOC */
#define BLIST_MAX_1024 0x40000000 /* maximum 1024 sector cdb length */
+#define BLIST_UNMAP_LIMIT_WS 0x80000000 /* Use UNMAP limit for WRITE SAME */
#endif