Skip to content

Commit 6e6dd5c

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 <[email protected]> Cc: Martin K. Petersen <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Ming Lei <[email protected]> Signed-off-by: Bart Van Assche <[email protected]>
1 parent 476e421 commit 6e6dd5c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

drivers/scsi/sd.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,13 @@ static blk_status_t sd_setup_read_write_cmnd(struct scsi_cmnd *cmd)
14041404
cmd->transfersize = sdp->sector_size;
14051405
cmd->underflow = nr_blocks << 9;
14061406
cmd->allowed = sdkp->max_retries;
1407+
/*
1408+
* Increase the number of allowed retries for zoned writes if the driver
1409+
* preserves the command order.
1410+
*/
1411+
if (rq->q->limits.driver_preserves_write_order &&
1412+
blk_rq_is_seq_zoned_write(rq))
1413+
cmd->allowed += rq->q->nr_requests;
14071414
cmd->sdb.length = nr_blocks * sdp->sector_size;
14081415

14091416
SCSI_LOG_HLQUEUE(1,

0 commit comments

Comments
 (0)