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
commit88514bc9b2517ca0f299b2d429751fe9c4276bed (patch)
tree07ddf6d319906e308d97fb2905885f38a6d1b6c2
parent226cfdd55897b0f47d58245a524c670eff7e5bf6 (diff)
parente365f138cb9c9c48b710864a9f37a91b4b93381d (diff)
Merge branch 'users/jdelvare/SLE15/for-next' into SLE15
Pull sd fix from Jean Delvare
-rw-r--r--patches.fixes/sd-disable-logical-block-provisioning-if-lbpme-is-no.patch45
-rw-r--r--series.conf1
2 files changed, 46 insertions, 0 deletions
diff --git a/patches.fixes/sd-disable-logical-block-provisioning-if-lbpme-is-no.patch b/patches.fixes/sd-disable-logical-block-provisioning-if-lbpme-is-no.patch
new file mode 100644
index 0000000000..9e158b8b53
--- /dev/null
+++ b/patches.fixes/sd-disable-logical-block-provisioning-if-lbpme-is-no.patch
@@ -0,0 +1,45 @@
+From: Hannes Reinecke <hare@suse.de>
+Date: Fri, 20 Apr 2018 15:44:40 +0200
+Subject: [PATCH] sd: disable logical block provisioning if 'lbpme' is not set
+Patch-Mainline: submitted linux-scsi 2018/10/03
+References: bsc#1086095 bsc#1078355
+
+When evaluating the 'block limits' VPD page we need to check if
+the 'lbpme' (logical block provisioning management enable) bit
+is set in the READ CAPACITY (16) output.
+If it isn't we can safely assume that we cannot use DISCARD on
+this device.
+
+Signed-off-by: Hannes Reinecke <hare@suse.com>
+---
+ drivers/scsi/sd.c | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+--- a/drivers/scsi/sd.c
++++ b/drivers/scsi/sd.c
+@@ -411,6 +411,13 @@ provisioning_mode_store(struct device *d
+ 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
+
+ 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]);
diff --git a/series.conf b/series.conf
index 2437aff21c..516b82647d 100644
--- a/series.conf
+++ b/series.conf
@@ -20683,6 +20683,7 @@
patches.suse/scsi-sr-workaround-VMware-ESXi-cdrom-emulation-bug.patch
patches.kabi/target-se_dev_attrib.emulate_pr-ABI-stability.patch
+ patches.fixes/sd-disable-logical-block-provisioning-if-lbpme-is-no.patch
########################################################
# DRM/Video