[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <538EBDAA.7090709@acm.org>
Date: Wed, 04 Jun 2014 08:33:14 +0200
From: Bart Van Assche <bvanassche@....org>
To: Paolo Bonzini <pbonzini@...hat.com>, linux-kernel@...r.kernel.org,
linux-scsi@...r.kernel.org
CC: hch@....de, JBottomley@...allels.com, venkateshs@...gle.com,
Ulrich Obergfell <uobergfe@...hat.com>
Subject: Re: [PATCH 4/6] scsi_error: fix invalid setting of host byte
On 06/03/14 21:33, Paolo Bonzini wrote:
> From: Ulrich Obergfell <uobergfe@...hat.com>
>
> After scsi_try_to_abort_cmd returns, the eh_abort_handler may have
> already found that the command has completed in the device, causing
> the host_byte to be nonzero (e.g. it could be DID_ABORT). When
> this happens, ORing DID_TIME_OUT into the host byte will corrupt
> the result field and initiate an unwanted command retry.
>
> Fix this by using set_host_byte instead, following the model of
> commit 2082ebc45af9c9c648383b8cde0dc1948eadbf31.
>
> Cc: stable@...r.kernel.org
> Signed-off-by: Ulrich Obergfell <uobergfe@...hat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@...hat.com>
> ---
> drivers/scsi/scsi_error.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
> index f17aa7aa7879..ab06ef6fd726 100644
> --- a/drivers/scsi/scsi_error.c
> +++ b/drivers/scsi/scsi_error.c
> @@ -131,7 +131,7 @@ scmd_eh_abort_handler(struct work_struct *work)
> "aborting command %p\n", scmd));
> rtn = scsi_try_to_abort_cmd(sdev->host->hostt, scmd);
> if (rtn == SUCCESS) {
> - scmd->result |= DID_TIME_OUT << 16;
> + set_host_byte(scmd, DID_TIME_OUT);
> if (scsi_host_eh_past_deadline(sdev->host)) {
> SCSI_LOG_ERROR_RECOVERY(3,
> scmd_printk(KERN_INFO, scmd,
There are three other occurrences in scsi_error.c of "scmd->result |=
DID_TIME_OUT << 16". Please modify all occurrences to keep the error
handling code consistent.
Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists