linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Rob Evers <revers@redhat.com>
Cc: linux-scsi@vger.kernel.org, michaelc@cs.wisc.edu
Subject: Re: [RFC PATCH] SCSI: Correct UA being ignored when notifying of media-changed
Date: Wed, 03 Aug 2011 17:22:08 -0500	[thread overview]
Message-ID: <1312410128.2855.94.camel@mulgrave> (raw)
In-Reply-To: <1312378758-17308-1-git-send-email-revers@redhat.com>

On Wed, 2011-08-03 at 09:39 -0400, Rob Evers wrote:
> Unit attention commands are getting ignored when a dvd is
> replaced, resulting in errors when accessing the new dvd.
> 
> This problem occurred when a system is booted in rescue
> mode via dvd and the dvd is then replaced with another dvd.
> Subsequent commands to a filesystem on the dvd, such as
> 'fsck' and 'restore' report errors.
> 
> Solution suggested by Mike Christie.
> 
> Signed-off-by: Rob Evers <revers@redhat.com>
> ---
>  drivers/scsi/scsi_error.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
> index a4b9cdb..725cc11 100644
> --- a/drivers/scsi/scsi_error.c
> +++ b/drivers/scsi/scsi_error.c
> @@ -294,6 +294,10 @@ static int scsi_check_sense(struct scsi_cmnd *scmd)
>  		 */
>  		if (scmd->device->expecting_cc_ua) {
>  			scmd->device->expecting_cc_ua = 0;
> +				if (sdev->removable) {
> +					sdev->changed = 1;
> +					return SUCCESS;
> +				}

Are you sure about this?  We only set expecting_cc_ua if the device was
reset in error handling ... and there we definitely *don't* want to
trigger a medium change.

Surely we want this at the end of the UA handling clause?

James



  parent reply	other threads:[~2011-08-03 22:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-03 13:39 [RFC PATCH] SCSI: Correct UA being ignored when notifying of media-changed Rob Evers
2011-08-03 22:06 ` Mike Christie
2011-08-03 22:22 ` James Bottomley [this message]
2011-08-03 22:31   ` Mike Christie
2011-08-03 22:36     ` James Bottomley
2011-08-03 23:14       ` Mike Christie
2011-08-08 22:50       ` TARUISI Hiroaki
2011-08-09 15:22         ` James Bottomley
2011-08-11 11:25           ` [PATCH] SCSI: Prevent from retrying with expecting_cc_ua in case of disk change TARUISI Hiroaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1312410128.2855.94.camel@mulgrave \
    --to=james.bottomley@hansenpartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    --cc=revers@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).