Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-02-12 22:18:26 +0100
committerJiri Slaby <jslaby@suse.cz>2019-02-12 22:21:26 +0100
commit54df0c1849715e0889f143de7440c56150374742 (patch)
tree26971bc453249582975ded80e1d5d7c10b9d01ed
parent7c4554c367b35390fa0090e29d59cd709f53cd74 (diff)
scsi: sd_zbc: Fix zone information messages (bnc#1012628).
-rw-r--r--patches.kernel.org/4.20.8-327-scsi-sd_zbc-Fix-zone-information-messages.patch62
-rw-r--r--series.conf1
2 files changed, 63 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.8-327-scsi-sd_zbc-Fix-zone-information-messages.patch b/patches.kernel.org/4.20.8-327-scsi-sd_zbc-Fix-zone-information-messages.patch
new file mode 100644
index 0000000000..0d59d22e87
--- /dev/null
+++ b/patches.kernel.org/4.20.8-327-scsi-sd_zbc-Fix-zone-information-messages.patch
@@ -0,0 +1,62 @@
+From: Damien Le Moal <damien.lemoal@wdc.com>
+Date: Wed, 30 Jan 2019 15:54:58 +0900
+Subject: [PATCH] scsi: sd_zbc: Fix zone information messages
+References: bnc#1012628
+Patch-mainline: 4.20.8
+Git-commit: 88fc41c407158a7d2eaa4b2f7cfa289749d456c6
+
+commit 88fc41c407158a7d2eaa4b2f7cfa289749d456c6 upstream.
+
+Commit bf5054569653 ("block: Introduce blk_revalidate_disk_zones()")
+inadvertently broke the message output of sd_zbc_print_zones() because the
+zone information initialization of the scsi disk structure was moved to the
+second scan run while sd_zbc_print_zones() is called on the first
+scan. This leads to the following incorrect message to be printed for any
+ZBC or ZAC zoned disks.
+
+"...[sdX] 4294967295 zones of 0 logical blocks + 1 runt zone"
+
+Fix this by initializing sdkp zone size and number of zones early on the
+first scan. This does not impact the execution of
+blk_revalidate_zones(). This functions is still called only once the block
+device capacity is set on the second revalidate run on boot, or if the disk
+zone configuration changed (i.e. the disk changed).
+
+Fixes: bf5054569653 ("block: Introduce blk_revalidate_disk_zones()")
+Cc: stable@vger.kernel.org
+Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/scsi/sd_zbc.c | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c
+index e06c48c866e4..3f81bab48ac2 100644
+--- a/drivers/scsi/sd_zbc.c
++++ b/drivers/scsi/sd_zbc.c
+@@ -462,12 +462,16 @@ int sd_zbc_read_zones(struct scsi_disk *sdkp, unsigned char *buf)
+ sdkp->device->use_10_for_rw = 0;
+
+ /*
+- * If something changed, revalidate the disk zone bitmaps once we have
+- * the capacity, that is on the second revalidate execution during disk
+- * scan and always during normal revalidate.
++ * Revalidate the disk zone bitmaps once the block device capacity is
++ * set on the second revalidate execution during disk scan and if
++ * something changed when executing a normal revalidate.
+ */
+- if (sdkp->first_scan)
++ if (sdkp->first_scan) {
++ sdkp->zone_blocks = zone_blocks;
++ sdkp->nr_zones = nr_zones;
+ return 0;
++ }
++
+ if (sdkp->zone_blocks != zone_blocks ||
+ sdkp->nr_zones != nr_zones ||
+ disk->queue->nr_zones != nr_zones) {
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index f14182b546..7167b1a71a 100644
--- a/series.conf
+++ b/series.conf
@@ -1063,6 +1063,7 @@
patches.kernel.org/4.20.8-324-usb-gadget-udc-net2272-Fix-bitwise-and-boolean.patch
patches.kernel.org/4.20.8-325-usb-gadget-musb-fix-short-isoc-packets-with-in.patch
patches.kernel.org/4.20.8-326-staging-speakup-fix-tty-operation-NULL-derefs.patch
+ patches.kernel.org/4.20.8-327-scsi-sd_zbc-Fix-zone-information-messages.patch
########################################################
# Build fixes that apply to the vanilla kernel too.