Skip to content

Commit 59fd0b9

Browse files
bvanasschekawasaki
authored andcommitted
scsi: sd: Increase retry count for zoned writes
If the write order is preserved, increase the number of retries for write commands sent to a sequential zone to the maximum number of outstanding commands because in the worst case the number of times reordered zoned writes have to be retried is (number of outstanding writes per sequential zone) - 1. Cc: Damien Le Moal <dlemoal@kernel.org> Cc: Martin K. Petersen <martin.petersen@oracle.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Ming Lei <ming.lei@redhat.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
1 parent 7fb0b92 commit 59fd0b9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/scsi/sd.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,6 +1409,13 @@ static blk_status_t sd_setup_read_write_cmnd(struct scsi_cmnd *cmd)
14091409
cmd->transfersize = sdp->sector_size;
14101410
cmd->underflow = nr_blocks << 9;
14111411
cmd->allowed = sdkp->max_retries;
1412+
/*
1413+
* Increase the number of allowed retries for zoned writes if the driver
1414+
* preserves the command order.
1415+
*/
1416+
if (rq->q->limits.features & BLK_FEAT_ORDERED_HWQ &&
1417+
blk_rq_is_seq_zoned_write(rq))
1418+
cmd->allowed += rq->q->nr_requests;
14121419
cmd->sdb.length = nr_blocks * sdp->sector_size;
14131420

14141421
SCSI_LOG_HLQUEUE(1,

0 commit comments

Comments
 (0)