]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit85a434858afbf05e3c38242058556fc005176f3f
treecbf7ae35d5d931a029e9decf8ee85234d259ba01
parent22ad4c9c8fef301cebd50ccd7b569f3e9ce9147a
scsi: sd_zbc: Fix zone information messages

Commit c2db2150f40d ("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: c2db2150f40d ("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