]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: sd: sd_zbc: Fix ZBC disk initialization
authorDamien Le Moal <damien.lemoal@wdc.com>
Tue, 15 Sep 2020 07:33:47 +0000 (16:33 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 16 Sep 2020 00:08:15 +0000 (20:08 -0400)
commit6acd4be0d18e16dfb1a850639e78ce4266d36a09
tree91485d0e79b8548fefcb0a29f2ba5e112c0f983e
parentb23ce636e1a060803f0727f2ace1a38d62c0b0b3
scsi: sd: sd_zbc: Fix ZBC disk initialization

Make sure to call sd_zbc_init_disk() when the sdkp->zoned field is known,
that is, once sd_read_block_characteristics() is executed in
sd_revalidate_disk(), so that host-aware disks also get initialized.  To do
so, move sd_zbc_init_disk() call in sd_zbc_revalidate_zones() and make sure
to execute it for all zoned disks, including for host-aware disks used as
regular disks as these disk zoned model may be changed back to BLK_ZONED_HA
when partitions are deleted.

Link: https://lore.kernel.org/r/20200915073347.832424-3-damien.lemoal@wdc.com
Fixes: b6ae81782883 ("scsi: sd_zbc: emulate ZONE_APPEND commands")
Cc: <stable@vger.kernel.org> # v5.8+
Reported-by: Borislav Petkov <bp@alien8.de>
Tested-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/sd.c
drivers/scsi/sd.h
drivers/scsi/sd_zbc.c