changeset 10259:139695f850ed

6855223 Do plumb/unplumb test with usb flash disk will cause system panic
author Nikko He <Li.He@Sun.COM>
date Wed, 05 Aug 2009 11:12:45 +0800
parents ecf43a496539
children 2896314db48b
files usr/src/uts/common/io/scsi/targets/sd.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/io/scsi/targets/sd.c	Tue Aug 04 18:20:38 2009 -0700
+++ b/usr/src/uts/common/io/scsi/targets/sd.c	Wed Aug 05 11:12:45 2009 +0800
@@ -16697,6 +16697,13 @@
 			un->un_mediastate = DKIO_DEV_GONE;
 			cv_broadcast(&un->un_state_cv);
 		}
+		/*
+		 * If the command happens to be the REQUEST SENSE command,
+		 * free up the rqs buf and fail the original command.
+		 */
+		if (bp == un->un_rqs_bp) {
+			bp = sd_mark_rqs_idle(un, xp);
+		}
 		sd_return_failed_command(un, bp, EIO);
 		goto exit;
 	}