mbox series

[v3,0/2] Fix handling of host-aware ZBC disks

Message ID 20200915073347.832424-1-damien.lemoal@wdc.com (mailing list archive)
Headers show
Series Fix handling of host-aware ZBC disks | expand

Message

Damien Le Moal Sept. 15, 2020, 7:33 a.m. UTC
Martin,

Two patches for this cycle (with a cc stable) to fix handling of
host-aware ZBC disks that have partitions, that is, used as regular
disks.

The first patch fixes host-aware disk initialization and command
completion processing. It also enables the use of host-aware disks as
regular disks when CONFIG_BLK_DEV_ZONED is disabled.

The second patch fixes the CONFIG_BLK_DEV_ZONED enabled configuration
so that zone append emulation is not initialized for host-aware disks
with partitions/used as regular disks. While at it, this patch also
removes a problem with sd_zbc_init_disk() error handling in
sd_revalidate_disk() by moving this function execution inside
sd_zbc_revalidate_zones().

Borislav tested the previous version of this series and confirmed that
it solves his problem (thanks Borislav !)

Changes from v2:
* Introduce blk_queue_set_zoned() helper function

Changes from v1:
* Rebased on rc5
* Use "if (IS_DEFINED())" instead of #ifdef in patch 1

Damien Le Moal (2):
  scsi: Fix handling of host-aware ZBC disks
  scsi: Fix ZBC disk initialization

 block/blk-settings.c   | 46 +++++++++++++++++++++++++++++
 drivers/scsi/sd.c      | 34 ++++++++++++----------
 drivers/scsi/sd.h      |  8 +----
 drivers/scsi/sd_zbc.c  | 66 +++++++++++++++++++++++++-----------------
 include/linux/blkdev.h |  2 ++
 5 files changed, 107 insertions(+), 49 deletions(-)

Comments

Martin K. Petersen Sept. 16, 2020, 12:09 a.m. UTC | #1
Damien,

> The first patch fixes host-aware disk initialization and command
> completion processing. It also enables the use of host-aware disks as
> regular disks when CONFIG_BLK_DEV_ZONED is disabled.
>
> The second patch fixes the CONFIG_BLK_DEV_ZONED enabled configuration
> so that zone append emulation is not initialized for host-aware disks
> with partitions/used as regular disks. While at it, this patch also
> removes a problem with sd_zbc_init_disk() error handling in
> sd_revalidate_disk() by moving this function execution inside
> sd_zbc_revalidate_zones().

Applied to 5.9/scsi-fixes, thanks!