]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
scsi: sd: Implement blacklist option for WRITE SAME w/ UNMAP
authorMartin K. Petersen <martin.petersen@oracle.com>
Thu, 28 Sep 2017 01:35:12 +0000 (21:35 -0400)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 19 Oct 2017 14:49:15 +0000 (09:49 -0500)
commitba3d3d9f11500fa560244f36bd9485aceec0e0d7
tree9dfa04e7ee4416f86b287249f9c4a9b82c6280be
parent510809dc345139b0eff2b531a38412f138383c8b
scsi: sd: Implement blacklist option for WRITE SAME w/ UNMAP

BugLink: http://bugs.launchpad.net/bugs/1723145
commit 28a0bc4120d38a394499382ba21d6965a67a3703 upstream.

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.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/scsi/scsi_scan.c
drivers/scsi/sd.c
include/scsi/scsi_device.h
include/scsi/scsi_devinfo.h