]> git.baikalelectronics.ru Git - kernel.git/commit
[SCSI] sd: Update WRITE SAME heuristics
authorMartin K. Petersen <martin.petersen@oracle.com>
Fri, 7 Jun 2013 02:15:55 +0000 (22:15 -0400)
committerJames Bottomley <JBottomley@Parallels.com>
Thu, 27 Jun 2013 00:56:18 +0000 (17:56 -0700)
commit1f0dc74a0405ba8895f803185f586fffd68e0574
treeec0f4ee9b3a34264f1d9c33df28ec89fbaf6561a
parent4be8910de89ae942ab59af388cd80ee7b72e074b
[SCSI] sd: Update WRITE SAME heuristics

SATA drives located behind a SAS controller would incorrectly receive
WRITE SAME commands. Tweak the heuristics so that:

 - If REPORT SUPPORTED OPERATION CODES is provided we will use that to
   choose between WRITE SAME(16), WRITE SAME(10) and disabled. This also
   fixes an issue with the old code which would issue WRITE SAME(10)
   despite the command not being whitelisted in REPORT SUPPORTED
   OPERATION CODES.

 - If REPORT SUPPORTED OPERATION CODES is not provided we will fall back
   to WRITE SAME(10) unless the device has an ATA Information VPD page.
   The assumption is that a SATL which is smart enough to implement
   WRITE SAME would also provide REPORT SUPPORTED OPERATION CODES.

To facilitate the new heuristics scsi_report_opcode() has been modified
to so we can distinguish between "operation not supported" and "RSOC not
supported".

Reported-by: H. Peter Anvin <hpa@zytor.com>
Tested-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/scsi.c
drivers/scsi/sd.c
drivers/scsi/sd.h