On 2020/10/07 14:50, Christoph Hellwig wrote: >> diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c >> index 7dda709f3ccb..78817d7acb66 100644 >> --- a/block/blk-sysfs.c >> +++ b/block/blk-sysfs.c >> @@ -246,6 +246,11 @@ queue_max_sectors_store(struct request_queue *q, const char >> *page, size_t count) >> spin_lock_irq(&q->queue_lock); >> q->limits.max_sectors = max_sectors_kb << 1; >> q->backing_dev_info->io_pages = max_sectors_kb >> (PAGE_SHIFT - 10); >> + >> + q->limits.max_zone_append_sectors = >> + min(q->limits.max_sectors, >> + q->limits.max_hw_zone_append_sectors); >> + >> spin_unlock_irq(&q->queue_lock); >> >> return ret; > > Yes, this looks pretty sensible. I'm not even sure we need the field, > just do the min where we build the bio instead of introducing another > field that needs to be maintained. Indeed, that would be even simpler. But that would also mean repeating that min call for every user. So may be we should just add a simple helper queue_get_max_zone_append_sectors() ? -- Damien Le Moal Western Digital Research