Skip to content

Commit 179c7a3

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 dd56555 commit 179c7a3

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
@@ -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)