summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sd.c
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.com>2019-09-03 12:18:39 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-29 09:19:49 +0100
commit0cea86f270e9e0a4e221ab2d169ae20c083eb4a0 (patch)
treed6a37d17ed1f913b40b5d00f912799a28409a92d /drivers/scsi/sd.c
parent3638ccda1009615d55d539970f61ddaab3ef9fc2 (diff)
downloadlinux-stable-0cea86f270e9e0a4e221ab2d169ae20c083eb4a0.tar.gz
linux-stable-0cea86f270e9e0a4e221ab2d169ae20c083eb4a0.tar.bz2
linux-stable-0cea86f270e9e0a4e221ab2d169ae20c083eb4a0.zip
scsi: sd: Ignore a failure to sync cache due to lack of authorization
commit 21e3d6c81179bbdfa279efc8de456c34b814cfd2 upstream. I've got a report about a UAS drive enclosure reporting back Sense: Logical unit access not authorized if the drive it holds is password protected. While the drive is obviously unusable in that state as a mass storage device, it still exists as a sd device and when the system is asked to perform a suspend of the drive, it will be sent a SYNCHRONIZE CACHE. If that fails due to password protection, the error must be ignored. Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20190903101840.16483-1-oneukum@suse.com Signed-off-by: Oliver Neukum <oneukum@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r--drivers/scsi/sd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 77cb45ef55fc..f8a09e6678d4 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1646,7 +1646,8 @@ static int sd_sync_cache(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr)
/* we need to evaluate the error return */
if (scsi_sense_valid(sshdr) &&
(sshdr->asc == 0x3a || /* medium not present */
- sshdr->asc == 0x20)) /* invalid command */
+ sshdr->asc == 0x20 || /* invalid command */
+ (sshdr->asc == 0x74 && sshdr->ascq == 0x71))) /* drive is password locked */
/* this is no error here */
return 0;