Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLee Duncan <lduncan@suse.com>2019-09-06 08:39:12 -0700
committerLee Duncan <lduncan@suse.com>2019-09-06 08:39:30 -0700
commita93ed361d16bdde3fd71fe0b927c328bbde988ef (patch)
tree01652bfb4fa9415563be8c91f27efe250ec20e48
parent9c03e5ba6ed50ff35fba0c8ba0e931a2def831c5 (diff)
scsi: sd: Fix cache_type_store() (git-fixes).
-rw-r--r--drivers/scsi/sd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index bf41019c26cb..fcfc6a38d359 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -206,6 +206,12 @@ cache_type_store(struct device *dev, struct device_attribute *attr,
sp = buffer_data[0] & 0x80 ? 1 : 0;
buffer_data[0] &= ~0x80;
+ /*
+ * Ensure WP, DPOFUA, and RESERVED fields are cleared in
+ * received mode parameter buffer before doing MODE SELECT.
+ */
+ data.device_specific = 0;
+
if (scsi_mode_select(sdp, 1, sp, 8, buffer_data, len, SD_TIMEOUT,
SD_MAX_RETRIES, &data, &sshdr)) {
if (scsi_sense_valid(&sshdr))