All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] SCSI: Correct UA being ignored when notifying of media-changed
@ 2011-08-03 13:39 Rob Evers
  2011-08-03 22:06 ` Mike Christie
  2011-08-03 22:22 ` James Bottomley
  0 siblings, 2 replies; 9+ messages in thread
From: Rob Evers @ 2011-08-03 13:39 UTC (permalink / raw)
  To: linux-scsi; +Cc: michaelc, James.Bottomley

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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-08-11 11:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.