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

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;
+				}
 			return NEEDS_RETRY;
 		}
 		/*
-- 
1.7.1


             reply	other threads:[~2011-08-03 13:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-03 13:39 Rob Evers [this message]
2011-08-03 22:06 ` [RFC PATCH] SCSI: Correct UA being ignored when notifying of media-changed Mike Christie
2011-08-03 22:22 ` James Bottomley
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=1312378758-17308-1-git-send-email-revers@redhat.com \
    --to=revers@redhat.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    /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).