OSDN Git Service

scsi: sd_zbc: Fix zone information messages
authorDamien Le Moal <damien.lemoal@wdc.com>
Wed, 30 Jan 2019 06:54:58 +0000 (15:54 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 5 Feb 2019 03:17:07 +0000 (22:17 -0500)
commit88fc41c407158a7d2eaa4b2f7cfa289749d456c6
treecbf7ae35d5d931a029e9decf8ee85234d259ba01
parentb6cd7f34ba1354498de03e6882c33f935b071e99
scsi: sd_zbc: Fix zone information messages

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>
drivers/scsi/sd_zbc.c