Re: [PATCH v8 5/9] scsi: core: Retry unaligned zoned writes
From: Damien Le Moal <dlemoal@kernel.org>
Date: 2023-08-16 01:13:51
Also in:
linux-scsi
On 8/16/23 02:29, Bart Van Assche wrote:
On 8/14/23 05:36, Damien Le Moal wrote:quoted
On 8/12/23 06:35, Bart Van Assche wrote:quoted
--- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c@@ -1238,6 +1238,8 @@ static blk_status_t sd_setup_read_write_cmnd(struct scsi_cmnd *cmd) cmd->transfersize = sdp->sector_size; cmd->underflow = nr_blocks << 9; cmd->allowed = sdkp->max_retries; + if (!rq->q->limits.use_zone_write_lock && blk_rq_is_seq_zoned_write(rq))This condition could be written as a little inline helper blk_req_need_zone_write_lock(), which could be used in mq-dealine patch 2.The above test differs from the tests in the mq-deadline I/O scheduler. The mq-deadline I/O scheduler uses write locking if rq->q->limits.use_zone_write_lock && q->disk->seq_zones_wlock && blk_rq_is_seq_zoned_write(rq). The above test is different and occurs two times in scsi_error.c and one time in sd.c. Do you still want me to introduce a helper function for that expression?
May be not needed. But a comment explaining it may be good to add. I still think that added the test for use_zone_write_lock in blk_req_needs_zone_write_lock() is needed though, for consistency of all functions related to zone locking.
Thanks, Bart.
-- Damien Le Moal Western Digital Research