From 7437bb73f087e5f216f9c6603f5149d354e315af Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sun, 17 Dec 2023 17:53:57 +0100 Subject: block: remove support for the host aware zone model When zones were first added the SCSI and ATA specs, two different models were supported (in addition to the drive managed one that is invisible to the host): - host managed where non-conventional zones there is strict requirement to write at the write pointer, or else an error is returned - host aware where a write point is maintained if writes always happen at it, otherwise it is left in an under-defined state and the sequential write preferred zones behave like conventional zones (probably very badly performing ones, though) Not surprisingly this lukewarm model didn't prove to be very useful and was finally removed from the ZBC and SBC specs (NVMe never implemented it). Due to to the easily disappearing write pointer host software could never rely on the write pointer to actually be useful for say recovery. Fortunately only a few HDD prototypes shipped using this model which never made it to mass production. Drop the support before it is too late. Note that any such host aware prototype HDD can still be used with Linux as we'll now treat it as a conventional HDD. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20231217165359.604246-4-hch@lst.de Signed-off-by: Jens Axboe --- drivers/scsi/scsi_debug.c | 27 +++++++++++++-------------- drivers/scsi/sd.c | 45 ++++++++++++++++++++------------------------- drivers/scsi/sd_zbc.c | 16 +--------------- 3 files changed, 34 insertions(+), 54 deletions(-) (limited to 'drivers/scsi') diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 6d8218a44122..d03d66f11493 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -339,7 +339,7 @@ struct sdebug_dev_info { bool used; /* For ZBC devices */ - enum blk_zoned_model zmodel; + bool zoned; unsigned int zcap; unsigned int zsize; unsigned int zsize_shift; @@ -844,8 +844,11 @@ static bool write_since_sync; static bool sdebug_statistics = DEF_STATISTICS; static bool sdebug_wp; static bool sdebug_allow_restart; -/* Following enum: 0: no zbc, def; 1: host aware; 2: host managed */ -static enum blk_zoned_model sdeb_zbc_model = BLK_ZONED_NONE; +static enum { + BLK_ZONED_NONE = 0, + BLK_ZONED_HA = 1, + BLK_ZONED_HM = 2, +} sdeb_zbc_model = BLK_ZONED_NONE; static char *sdeb_zbc_model_s; enum sam_lun_addr_method {SAM_LUN_AM_PERIPHERAL = 0x0, @@ -1815,8 +1818,6 @@ static int inquiry_vpd_b1(struct sdebug_dev_info *devip, unsigned char *arr) arr[1] = 1; /* non rotating medium (e.g. solid state) */ arr[2] = 0; arr[3] = 5; /* less than 1.8" */ - if (devip->zmodel == BLK_ZONED_HA) - arr[4] = 1 << 4; /* zoned field = 01b */ return 0x3c; } @@ -1883,7 +1884,7 @@ static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) if (! arr) return DID_REQUEUE << 16; is_disk = (sdebug_ptype == TYPE_DISK); - is_zbc = (devip->zmodel != BLK_ZONED_NONE); + is_zbc = devip->zoned; is_disk_zbc = (is_disk || is_zbc); have_wlun = scsi_is_wlun(scp->device->lun); if (have_wlun) @@ -2195,7 +2196,7 @@ static int resp_readcap16(struct scsi_cmnd *scp, * Since the scsi_debug READ CAPACITY implementation always reports the * total disk capacity, set RC BASIS = 1 for host-managed ZBC devices. */ - if (devip->zmodel == BLK_ZONED_HM) + if (devip->zoned) arr[12] |= 1 << 4; arr[15] = sdebug_lowest_aligned & 0xff; @@ -2648,7 +2649,7 @@ static int resp_mode_sense(struct scsi_cmnd *scp, msense_6 = (MODE_SENSE == cmd[0]); llbaa = msense_6 ? false : !!(cmd[1] & 0x10); is_disk = (sdebug_ptype == TYPE_DISK); - is_zbc = (devip->zmodel != BLK_ZONED_NONE); + is_zbc = devip->zoned; if ((is_disk || is_zbc) && !dbd) bd_len = llbaa ? 16 : 8; else @@ -3194,8 +3195,6 @@ static int check_zbc_access_params(struct scsi_cmnd *scp, struct sdeb_zone_state *zsp_end = zbc_zone(devip, lba + num - 1); if (!write) { - if (devip->zmodel == BLK_ZONED_HA) - return 0; /* For host-managed, reads cannot cross zone types boundaries */ if (zsp->z_type != zsp_end->z_type) { mk_sense_buffer(scp, ILLEGAL_REQUEST, @@ -5322,7 +5321,7 @@ static int sdebug_device_create_zones(struct sdebug_dev_info *devip) if (devip->zcap < devip->zsize) devip->nr_zones += devip->nr_seq_zones; - if (devip->zmodel == BLK_ZONED_HM) { + if (devip->zoned) { /* zbc_max_open_zones can be 0, meaning "not reported" */ if (sdeb_zbc_max_open >= devip->nr_zones - 1) devip->max_open = (devip->nr_zones - 1) / 2; @@ -5347,7 +5346,7 @@ static int sdebug_device_create_zones(struct sdebug_dev_info *devip) zsp->z_size = min_t(u64, devip->zsize, capacity - zstart); } else if ((zstart & (devip->zsize - 1)) == 0) { - if (devip->zmodel == BLK_ZONED_HM) + if (devip->zoned) zsp->z_type = ZBC_ZTYPE_SWR; else zsp->z_type = ZBC_ZTYPE_SWP; @@ -5390,13 +5389,13 @@ static struct sdebug_dev_info *sdebug_device_create( } devip->sdbg_host = sdbg_host; if (sdeb_zbc_in_use) { - devip->zmodel = sdeb_zbc_model; + devip->zoned = sdeb_zbc_model == BLK_ZONED_HM; if (sdebug_device_create_zones(devip)) { kfree(devip); return NULL; } } else { - devip->zmodel = BLK_ZONED_NONE; + devip->zoned = false; } devip->create_ts = ktime_get_boottime(); atomic_set(&devip->stopped, (sdeb_tur_ms_to_ready > 0 ? 2 : 0)); diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index fa00dd503cbf..19a19eb277f5 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -3117,7 +3117,6 @@ static void sd_read_block_characteristics(struct scsi_disk *sdkp) struct request_queue *q = sdkp->disk->queue; struct scsi_vpd *vpd; u16 rot; - u8 zoned; rcu_read_lock(); vpd = rcu_dereference(sdkp->device->vpd_pgb1); @@ -3128,7 +3127,7 @@ static void sd_read_block_characteristics(struct scsi_disk *sdkp) } rot = get_unaligned_be16(&vpd->data[4]); - zoned = (vpd->data[8] >> 4) & 3; + sdkp->zoned = (vpd->data[8] >> 4) & 3; rcu_read_unlock(); if (rot == 1) { @@ -3138,37 +3137,33 @@ static void sd_read_block_characteristics(struct scsi_disk *sdkp) if (sdkp->device->type == TYPE_ZBC) { /* - * Host-managed: Per ZBC and ZAC specifications, writes in - * sequential write required zones of host-managed devices must - * be aligned to the device physical block size. + * Host-managed. + */ + disk_set_zoned(sdkp->disk, true); + + /* + * Per ZBC and ZAC specifications, writes in sequential write + * required zones of host-managed devices must be aligned to + * the device physical block size. */ - disk_set_zoned(sdkp->disk, BLK_ZONED_HM); blk_queue_zone_write_granularity(q, sdkp->physical_block_size); } else { - sdkp->zoned = zoned; - if (sdkp->zoned == 1) { - /* Host-aware */ - disk_set_zoned(sdkp->disk, BLK_ZONED_HA); - } else { - /* Regular disk or drive managed disk */ - disk_set_zoned(sdkp->disk, BLK_ZONED_NONE); - } + /* + * Anything else. This includes host-aware device that we treat + * as conventional. + */ + disk_set_zoned(sdkp->disk, false); } if (!sdkp->first_scan) return; - if (blk_queue_is_zoned(q)) { - sd_printk(KERN_NOTICE, sdkp, "Host-%s zoned block device\n", - q->limits.zoned == BLK_ZONED_HM ? "managed" : "aware"); - } else { - if (sdkp->zoned == 1) - sd_printk(KERN_NOTICE, sdkp, - "Host-aware SMR disk used as regular disk\n"); - else if (sdkp->zoned == 2) - sd_printk(KERN_NOTICE, sdkp, - "Drive-managed SMR disk\n"); - } + if (blk_queue_is_zoned(q)) + sd_printk(KERN_NOTICE, sdkp, "Host-managed zoned block device\n"); + else if (sdkp->zoned == 1) + sd_printk(KERN_NOTICE, sdkp, "Host-aware SMR disk used as regular disk\n"); + else if (sdkp->zoned == 2) + sd_printk(KERN_NOTICE, sdkp, "Drive-managed SMR disk\n"); } /** diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c index a25215507668..26af5ab7d7c1 100644 --- a/drivers/scsi/sd_zbc.c +++ b/drivers/scsi/sd_zbc.c @@ -836,10 +836,7 @@ int sd_zbc_revalidate_zones(struct scsi_disk *sdkp) /* * For all zoned disks, initialize zone append emulation data if not - * already done. This is necessary also for host-aware disks used as - * regular disks due to the presence of partitions as these partitions - * may be deleted and the disk zoned model changed back from - * BLK_ZONED_NONE to BLK_ZONED_HA. + * already done. */ if (sd_is_zoned(sdkp) && !sdkp->zone_wp_update_buf) { ret = sd_zbc_init_disk(sdkp); @@ -932,17 +929,6 @@ int sd_zbc_read_zones(struct scsi_disk *sdkp, u8 buf[SD_BUF_SIZE]) sdkp->device->use_10_for_rw = 0; sdkp->device->use_16_for_sync = 1; - if (!blk_queue_is_zoned(q)) { - /* - * This can happen for a host aware disk with partitions. - * The block device zone model was already cleared by - * disk_set_zoned(). Only free the scsi disk zone - * information and exit early. - */ - sd_zbc_free_zone_info(sdkp); - return 0; - } - /* Check zoned block device characteristics (unconstrained reads) */ ret = sd_zbc_check_zoned_characteristics(sdkp, buf); if (ret) -- cgit v1.2.3 From d73e93b4dfab10c80688b061c30048df05585c7e Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sun, 17 Dec 2023 17:53:58 +0100 Subject: block: simplify disk_set_zoned Only use disk_set_zoned to actually enable zoned device support. For clearing it, call disk_clear_zoned, which is renamed from disk_clear_zone_settings and now directly clears the zoned flag as well. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20231217165359.604246-5-hch@lst.de Signed-off-by: Jens Axboe --- block/blk-settings.c | 32 +++++++++++--------------------- block/blk-zoned.c | 3 ++- block/blk.h | 2 -- drivers/block/null_blk/zoned.c | 2 +- drivers/block/ublk_drv.c | 2 +- drivers/block/virtio_blk.c | 2 +- drivers/nvme/host/zns.c | 2 +- drivers/scsi/sd.c | 7 +++++-- include/linux/blkdev.h | 3 ++- 9 files changed, 24 insertions(+), 31 deletions(-) (limited to 'drivers/scsi') diff --git a/block/blk-settings.c b/block/blk-settings.c index 50e9efb59f67..bb94a3d471f4 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -881,31 +881,21 @@ bool blk_queue_can_use_dma_map_merging(struct request_queue *q, EXPORT_SYMBOL_GPL(blk_queue_can_use_dma_map_merging); /** - * disk_set_zoned - configure the zoned model for a disk - * @disk: the gendisk of the queue to configure - * @zoned: zoned or not. - * - * When @zoned is %true, this should be called only if zoned block device - * support is enabled (CONFIG_BLK_DEV_ZONED option). + * disk_set_zoned - inidicate a zoned device + * @disk: gendisk to configure */ -void disk_set_zoned(struct gendisk *disk, bool zoned) +void disk_set_zoned(struct gendisk *disk) { struct request_queue *q = disk->queue; - if (zoned) { - WARN_ON_ONCE(!IS_ENABLED(CONFIG_BLK_DEV_ZONED)); - - /* - * Set the zone write granularity to the device logical block - * size by default. The driver can change this value if needed. - */ - q->limits.zoned = true; - blk_queue_zone_write_granularity(q, - queue_logical_block_size(q)); - } else if (q->limits.zoned) { - q->limits.zoned = false; - disk_clear_zone_settings(disk); - } + WARN_ON_ONCE(!IS_ENABLED(CONFIG_BLK_DEV_ZONED)); + + /* + * Set the zone write granularity to the device logical block + * size by default. The driver can change this value if needed. + */ + q->limits.zoned = true; + blk_queue_zone_write_granularity(q, queue_logical_block_size(q)); } EXPORT_SYMBOL_GPL(disk_set_zoned); diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 619ee41a51cc..580a58e53efd 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -616,12 +616,13 @@ int blk_revalidate_disk_zones(struct gendisk *disk, } EXPORT_SYMBOL_GPL(blk_revalidate_disk_zones); -void disk_clear_zone_settings(struct gendisk *disk) +void disk_clear_zoned(struct gendisk *disk) { struct request_queue *q = disk->queue; blk_mq_freeze_queue(q); + q->limits.zoned = false; disk_free_zone_bitmaps(disk); blk_queue_flag_clear(QUEUE_FLAG_ZONE_RESETALL, q); q->required_elevator_features &= ~ELEVATOR_F_ZBD_SEQ_WRITE; diff --git a/block/blk.h b/block/blk.h index 08a358bc0919..1ef920f72e0f 100644 --- a/block/blk.h +++ b/block/blk.h @@ -395,14 +395,12 @@ static inline struct bio *blk_queue_bounce(struct bio *bio, #ifdef CONFIG_BLK_DEV_ZONED void disk_free_zone_bitmaps(struct gendisk *disk); -void disk_clear_zone_settings(struct gendisk *disk); int blkdev_report_zones_ioctl(struct block_device *bdev, unsigned int cmd, unsigned long arg); int blkdev_zone_mgmt_ioctl(struct block_device *bdev, blk_mode_t mode, unsigned int cmd, unsigned long arg); #else /* CONFIG_BLK_DEV_ZONED */ static inline void disk_free_zone_bitmaps(struct gendisk *disk) {} -static inline void disk_clear_zone_settings(struct gendisk *disk) {} static inline int blkdev_report_zones_ioctl(struct block_device *bdev, unsigned int cmd, unsigned long arg) { diff --git a/drivers/block/null_blk/zoned.c b/drivers/block/null_blk/zoned.c index 369eb1e78bb5..6f5e0994862e 100644 --- a/drivers/block/null_blk/zoned.c +++ b/drivers/block/null_blk/zoned.c @@ -159,7 +159,7 @@ int null_register_zoned_dev(struct nullb *nullb) struct nullb_device *dev = nullb->dev; struct request_queue *q = nullb->q; - disk_set_zoned(nullb->disk, true); + disk_set_zoned(nullb->disk); blk_queue_flag_set(QUEUE_FLAG_ZONE_RESETALL, q); blk_queue_required_elevator_features(q, ELEVATOR_F_ZBD_SEQ_WRITE); blk_queue_chunk_sectors(q, dev->zone_size_sects); diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index 24fb95f19d52..d50d69b2c023 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -250,7 +250,7 @@ static int ublk_dev_param_zoned_apply(struct ublk_device *ub) { const struct ublk_param_zoned *p = &ub->params.zoned; - disk_set_zoned(ub->ub_disk, true); + disk_set_zoned(ub->ub_disk); blk_queue_flag_set(QUEUE_FLAG_ZONE_RESETALL, ub->ub_disk->queue); blk_queue_required_elevator_features(ub->ub_disk->queue, ELEVATOR_F_ZBD_SEQ_WRITE); diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 19a4f20bd1c2..7d7a19b2b9a8 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -730,7 +730,7 @@ static int virtblk_probe_zoned_device(struct virtio_device *vdev, dev_dbg(&vdev->dev, "probing host-managed zoned device\n"); - disk_set_zoned(vblk->disk, true); + disk_set_zoned(vblk->disk); blk_queue_flag_set(QUEUE_FLAG_ZONE_RESETALL, q); virtio_cread(vdev, struct virtio_blk_config, diff --git a/drivers/nvme/host/zns.c b/drivers/nvme/host/zns.c index 6d4c440e97e2..3d98e435821e 100644 --- a/drivers/nvme/host/zns.c +++ b/drivers/nvme/host/zns.c @@ -108,7 +108,7 @@ int nvme_update_zone_info(struct nvme_ns *ns, unsigned lbaf) goto free_data; } - disk_set_zoned(ns->disk, true); + disk_set_zoned(ns->disk); blk_queue_flag_set(QUEUE_FLAG_ZONE_RESETALL, q); disk_set_max_open_zones(ns->disk, le32_to_cpu(id->mor) + 1); disk_set_max_active_zones(ns->disk, le32_to_cpu(id->mar) + 1); diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 19a19eb277f5..dbed075cdb98 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -3135,11 +3135,13 @@ static void sd_read_block_characteristics(struct scsi_disk *sdkp) blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, q); } + +#ifdef CONFIG_BLK_DEV_ZONED /* sd_probe rejects ZBD devices early otherwise */ if (sdkp->device->type == TYPE_ZBC) { /* * Host-managed. */ - disk_set_zoned(sdkp->disk, true); + disk_set_zoned(sdkp->disk); /* * Per ZBC and ZAC specifications, writes in sequential write @@ -3152,8 +3154,9 @@ static void sd_read_block_characteristics(struct scsi_disk *sdkp) * Anything else. This includes host-aware device that we treat * as conventional. */ - disk_set_zoned(sdkp->disk, false); + disk_clear_zoned(sdkp->disk); } +#endif /* CONFIG_BLK_DEV_ZONED */ if (!sdkp->first_scan) return; diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 28cda9fb239e..bc236e77d85e 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -317,7 +317,8 @@ struct queue_limits { typedef int (*report_zones_cb)(struct blk_zone *zone, unsigned int idx, void *data); -void disk_set_zoned(struct gendisk *disk, bool zoned); +void disk_set_zoned(struct gendisk *disk); +void disk_clear_zoned(struct gendisk *disk); #define BLK_ALL_ZONES ((unsigned int)-1) int blkdev_report_zones(struct block_device *bdev, sector_t sector, -- cgit v1.2.3 From 5cc99b89785c55430a5674b32ad0d9e57a8ec251 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sun, 17 Dec 2023 17:53:59 +0100 Subject: sd: only call disk_clear_zoned when needed disk_clear_zoned only needs to be called when a device reported zone managed mode first and we clear it. Add a check so that disk_clear_zoned isn't called on devices that were never zoned. This avoids a fairly expensive queue freezing when revalidating conventional devices. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20231217165359.604246-6-hch@lst.de Signed-off-by: Jens Axboe --- drivers/scsi/sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/scsi') diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index dbed075cdb98..8c8ac5cd1833 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -3149,7 +3149,7 @@ static void sd_read_block_characteristics(struct scsi_disk *sdkp) * the device physical block size. */ blk_queue_zone_write_granularity(q, sdkp->physical_block_size); - } else { + } else if (blk_queue_is_zoned(q)) { /* * Anything else. This includes host-aware device that we treat * as conventional. -- cgit v1.2.3 From d6b9f4e6f7fb589d8024a31cc4883d15d0c8def4 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 27 Dec 2023 09:23:05 +0000 Subject: block: rename and document BLK_DEF_MAX_SECTORS Give BLK_DEF_MAX_SECTORS a _CAP postfix and document what it is used for. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20231227092305.279567-5-hch@lst.de Signed-off-by: Jens Axboe --- block/blk-settings.c | 2 +- block/blk-sysfs.c | 2 +- drivers/scsi/sd.c | 2 +- include/linux/blkdev.h | 9 ++++++++- 4 files changed, 11 insertions(+), 4 deletions(-) (limited to 'drivers/scsi') diff --git a/block/blk-settings.c b/block/blk-settings.c index 33b3f767b81e..ba6e0e97118c 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -139,7 +139,7 @@ void blk_queue_max_hw_sectors(struct request_queue *q, unsigned int max_hw_secto if (limits->max_user_sectors) max_sectors = min(max_sectors, limits->max_user_sectors); else - max_sectors = min(max_sectors, BLK_DEF_MAX_SECTORS); + max_sectors = min(max_sectors, BLK_DEF_MAX_SECTORS_CAP); max_sectors = round_down(max_sectors, limits->logical_block_size >> SECTOR_SHIFT); diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index d5e669a401b0..40bab5975c56 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -241,7 +241,7 @@ queue_max_sectors_store(struct request_queue *q, const char *page, size_t count) if (max_sectors_kb == 0) { q->limits.max_user_sectors = 0; max_sectors_kb = min(max_hw_sectors_kb, - BLK_DEF_MAX_SECTORS >> 1); + BLK_DEF_MAX_SECTORS_CAP >> 1); } else { if (max_sectors_kb > max_hw_sectors_kb || max_sectors_kb < page_kb) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 8c8ac5cd1833..6bedd2d5298f 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -3500,7 +3500,7 @@ static int sd_revalidate_disk(struct gendisk *disk) } else { q->limits.io_opt = 0; rw_max = min_not_zero(logical_to_sectors(sdp, dev_max), - (sector_t)BLK_DEF_MAX_SECTORS); + (sector_t)BLK_DEF_MAX_SECTORS_CAP); } /* diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index bc236e77d85e..94701a63ad8a 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1056,7 +1056,14 @@ enum blk_default_limits { BLK_SEG_BOUNDARY_MASK = 0xFFFFFFFFUL, }; -#define BLK_DEF_MAX_SECTORS 2560u +/* + * Default upper limit for the software max_sectors limit used for + * regular file system I/O. This can be increased through sysfs. + * + * Not to be confused with the max_hw_sector limit that is entirely + * controlled by the driver, usually based on hardware limits. + */ +#define BLK_DEF_MAX_SECTORS_CAP 2560u static inline unsigned long queue_segment_boundary(const struct request_queue *q) { -- cgit v1.2.3 From 6945a1804e5c2a3382232a8d6c2143930b833362 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 28 Dec 2023 07:51:40 +0000 Subject: sd: remove the !ZBC && blk_queue_is_zoned case in sd_read_block_characteristics Now that host-aware devices are always treated as conventional this case can't happen. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20231228075141.362560-2-hch@lst.de Signed-off-by: Jens Axboe --- drivers/scsi/sd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'drivers/scsi') diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 6bedd2d5298f..dace4aa8e353 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -3149,12 +3149,11 @@ static void sd_read_block_characteristics(struct scsi_disk *sdkp) * the device physical block size. */ blk_queue_zone_write_granularity(q, sdkp->physical_block_size); - } else if (blk_queue_is_zoned(q)) { + } else { /* - * Anything else. This includes host-aware device that we treat - * as conventional. + * Host-aware devices are treated as conventional. */ - disk_clear_zoned(sdkp->disk); + WARN_ON_ONCE(blk_queue_is_zoned(q)); } #endif /* CONFIG_BLK_DEV_ZONED */ -- cgit v1.2.3