public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] Fix device not ready printk
@ 2007-06-29 13:21 Matthew Wilcox
  2007-07-19 18:51 ` Matthew Wilcox
  0 siblings, 1 reply; 5+ messages in thread
From: Matthew Wilcox @ 2007-06-29 13:21 UTC (permalink / raw)
  To: linux-scsi


scsi_print_sense_hdr prints KERN_INFO, making the output from
scsi_io_completion ugly:

sd 0:0:0:0: [sdb] Device not ready: <6>: Sense Key : 0x2 [current] 
: ASC=0x4 ASCQ=0x3

By duplicating some of the code from it, we can get the nicer output:

sd 0:0:0:0: [sdb] Device not ready: Sense Key : Not Ready [current] 
sd 0:0:0:0: [sdb] Device not ready: Add. Sense: Logical unit not ready, manual intervention required

(the observant will notice that I turned on SCSI_CONSTANTS between the
two kernels)

I'm in two minds about printing the 'Device not ready' twice.  On the
one hand, it's redundant information.  On the other hand, it helps the
harried sysadmin with multiple simultaneous disc failures tie the two
messages together.

So I'm not signing off on this because I think it warrants further discussion.

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 1f5a07b..d0b8608 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -940,7 +940,10 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
 			if (!(req->cmd_flags & REQ_QUIET)) {
 				scmd_printk(KERN_INFO, cmd,
 					    "Device not ready: ");
-				scsi_print_sense_hdr("", &sshdr);
+				scsi_show_sense_hdr(&sshdr);
+				scmd_printk(KERN_INFO, cmd,
+					    "Device not ready: ");
+				scsi_show_extd_sense(sshdr.asc, sshdr.ascq);
 			}
 			scsi_end_request(cmd, 0, this_count, 1);
 			return;

-- 
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

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

end of thread, other threads:[~2007-09-23 14:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-29 13:21 [RFC] Fix device not ready printk Matthew Wilcox
2007-07-19 18:51 ` Matthew Wilcox
2007-07-19 19:05   ` Martin K. Petersen
2007-09-23 14:08   ` James Bottomley
2007-09-23 14:25     ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox