]> git.baikalelectronics.ru Git - kernel.git/commit
sd: Avoid sending medium write commands if device is write protected
authorSujit Reddy Thumma <sthumma@codeaurora.org>
Mon, 11 Aug 2014 12:40:37 +0000 (15:40 +0300)
committerChristoph Hellwig <hch@lst.de>
Mon, 15 Sep 2014 23:01:57 +0000 (16:01 -0700)
commit4b0348c0e484b8b0eb738cc678c82d71bf56d3e1
tree9010e184d6af69458b34cf6239ba2e4ba6ef8c9c
parente2ebfb01ceedd4a95c321b2e633c0ca0cb8eb1e7
sd: Avoid sending medium write commands if device is write protected

The SYNCHRONIZE_CACHE command is a medium write command and hence can
fail when the device is write protected. Avoid sending such commands by
making sure that write-cache-enable is disabled even though the device
claim to support it.

Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Signed-off-by: Dolev Raviv <draviv@codeaurora.org>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Venkatesh Srinivas <venkateshs@google.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/sd.c