Home Home > GIT Browse > SLE12-SP3-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKernel Build Daemon <kbuild@suse.de>2019-02-15 07:00:23 +0100
committerKernel Build Daemon <kbuild@suse.de>2019-02-15 07:00:23 +0100
commit9f8ae667bc80eaffbc324872befd5aeaeedc6c20 (patch)
tree4c728c2f8332ad5929b4448d09179eebbb8c89dc
parent692c0439272cc98e39e95ab72161a5d9498754f6 (diff)
parent96370bd87299c7a6883b3e2bf13818f60c8ba611 (diff)
Merge branch 'SLE12-SP3' into SLE12-SP3-AZURE
-rw-r--r--patches.fixes/sd-disable-logical-block-provisioning-if-lbpme-is-no.patch45
-rw-r--r--series.conf3
2 files changed, 48 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..10802746e0
--- /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 managment 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
+@@ -415,6 +415,13 @@ provisioning_mode_store(struct device *d
+ if (sdp->type != TYPE_DISK)
+ return -EINVAL;
+
++ /*
++ * If logical block provisioning isn't enabled we can only
++ * select 'disable' here.
++ */
++ if (!sdkp->lbpme && strncmp(buf, lbp_mode[SD_LBP_DISABLE], 20))
++ return -EINVAL;
++
+ if (!strncmp(buf, lbp_mode[SD_LBP_UNMAP], 20))
+ sd_config_discard(sdkp, SD_LBP_UNMAP);
+ else if (!strncmp(buf, lbp_mode[SD_LBP_WS16], 20))
+@@ -2789,8 +2796,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 54d47c9852..05669ee328 100644
--- a/series.conf
+++ b/series.conf
@@ -25282,6 +25282,9 @@
# Generic badblock management
patches.drivers/0006-badblocks-fix-wrong-return-value-when-badblocks-are-disabled.patch
+ patches.fixes/sd-disable-logical-block-provisioning-if-lbpme-is-no.patch
+
+
##########################################################
# crypto acceleration
##########################################################