Commit 2dffc600 authored by Bart Van Assche's avatar Bart Van Assche
Browse files

ANDROID: scsi: core: Delay unaligned write error retries



Host-managed zoned block devices report the sense code 21h/04h
(UNALIGNED WRITE COMMAND) when attempting to write data at another LBA
than the write pointer. Retry unaligned writes after all other pending
commands have completed instead of retrying these immediately. The
change in this patch makes the following function decide to queue the
failed command to the error handler instead of retrying it immediately:

static void scsi_complete(struct request *rq)
{
	[ ... ]
	switch (disposition) {
	case SUCCESS:
		scsi_finish_command(cmd);
		break;
	case NEEDS_RETRY:
		scsi_queue_insert(cmd, SCSI_MLQUEUE_EH_RETRY);
		break;
	case ADD_TO_MLQUEUE:
		scsi_queue_insert(cmd, SCSI_MLQUEUE_DEVICE_BUSY);
		break;
	default:
		scsi_eh_scmd_add(cmd);
		break;
	}
}

This patch has not been posted on any Linux kernel mailing list since
there is agreement that another approach will be taken to preserve the
order of WRITE commands for zoned devices. However, the implementation
of that new approach is not yet available.

Bug: 197782466
Change-Id: I3529ce4f01ff166a0c8ac321eb31b0e7771906ac
Signed-off-by: default avatarBart Van Assche <bvanassche@google.com>
parent a27981ad
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment