Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-02-14 19:47:19 +0100
committerTakashi Iwai <tiwai@suse.de>2019-02-14 19:47:19 +0100
commit885b807a6c73faab7e6e6acf04b89f15e75baa47 (patch)
tree3fa386eaeb7742a0adfc8aae0ef97e1970026c01
parent88d17b6351688c4093322a154a63911c9bb487f2 (diff)
parent63e716455c756ccbf5722cf3a7764cfe902a4a14 (diff)
Merge branch 'users/jdelvare/SLE15/for-next' into SLE15
Pull sd fix from Jean Delvare suse-commit: 88514bc9b2517ca0f299b2d429751fe9c4276bed
-rw-r--r--drivers/scsi/sd.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index d9c03f894f55..7549d53df485 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -411,6 +411,13 @@ provisioning_mode_store(struct device *dev, struct device_attribute *attr,
if (mode < 0)
return -EINVAL;
+ /*
+ * If logical block provisioning isn't enabled we can only
+ * select 'disable' here.
+ */
+ if (!sdkp->lbpme && mode != SD_LBP_DISABLE)
+ return -EINVAL;
+
sd_config_discard(sdkp, mode);
return count;
@@ -2942,8 +2949,10 @@ static void sd_read_block_limits(struct scsi_disk *sdkp)
sdkp->max_ws_blocks = (u32)get_unaligned_be64(&buffer[36]);
- if (!sdkp->lbpme)
+ if (!sdkp->lbpme) {
+ sd_config_discard(sdkp, SD_LBP_DISABLE);
goto out;
+ }
lba_count = get_unaligned_be32(&buffer[20]);
desc_count = get_unaligned_be32(&buffer[24]);