public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix up short inquiry printing
@ 2006-08-06 23:15 James Bottomley
  2006-08-07  2:46 ` Matthew Wilcox
  0 siblings, 1 reply; 3+ messages in thread
From: James Bottomley @ 2006-08-06 23:15 UTC (permalink / raw)
  To: linux-scsi; +Cc: Matthew Wilcox

A recent drivers base commit:

3e95637a48820ff8bedb33e6439def96ccff1de5

Caused the bus to be added to dev_printk, so now our SCSI inquiry short
messages print like this:

scsiscsi 2:0:0:0: Direct access     IBM-ESXS ST973401SS       B519 PQ: 0 ANSI: 5

Just remove the "scsi" from the sdev_printk to compensate.

James

diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 1803994..114e206 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -659,7 +659,7 @@ static int scsi_add_lun(struct scsi_devi
 	if (inq_result[7] & 0x10)
 		sdev->sdtr = 1;
 
-	sdev_printk(KERN_NOTICE "scsi", sdev, "%s %.8s %.16s %.4s PQ: %d "
+	sdev_printk(KERN_NOTICE, sdev, "%s %.8s %.16s %.4s PQ: %d "
 			"ANSI: %d%s\n", scsi_device_type(sdev->type),
 			sdev->vendor, sdev->model, sdev->rev,
 			sdev->inq_periph_qual, inq_result[2] & 0x07,



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

* Re: [PATCH] fix up short inquiry printing
  2006-08-06 23:15 [PATCH] fix up short inquiry printing James Bottomley
@ 2006-08-07  2:46 ` Matthew Wilcox
  2006-08-07 17:03   ` James Bottomley
  0 siblings, 1 reply; 3+ messages in thread
From: Matthew Wilcox @ 2006-08-07  2:46 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi

On Sun, Aug 06, 2006 at 06:15:22PM -0500, James Bottomley wrote:
> Caused the bus to be added to dev_printk, so now our SCSI inquiry short
> messages print like this:
> 
> scsiscsi 2:0:0:0: Direct access     IBM-ESXS ST973401SS       B519 PQ: 0 ANSI: 5
> 
> Just remove the "scsi" from the sdev_printk to compensate.

Yes, that's clearly the right thing to do, thanks for fixing that up.

I think we should probably switch sdev_printk() to its own custom
implementation rather than just calling dev_printk().  Greg didn't seem
to be interested in fixing the problem that we have with dev_printk();
presumably he has some other users in mind for which the current
dev_printk behaviour is useful.

How does something like the following look (compile tested):

Index: include/scsi/scsi_device.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/scsi/scsi_device.h,v
retrieving revision 1.28
diff -u -p -r1.28 scsi_device.h
--- include/scsi/scsi_device.h	19 May 2006 02:43:19 -0000	1.28
+++ include/scsi/scsi_device.h	7 Aug 2006 02:45:24 -0000
@@ -151,10 +151,10 @@ struct scsi_device {
 	to_scsi_device(class_dev->dev)
 
 #define sdev_printk(prefix, sdev, fmt, a...)	\
-	dev_printk(prefix, &(sdev)->sdev_gendev, fmt, ##a)
+	printk(prefix "scsi %s: " fmt, (sdev)->sdev_gendev.bus_id , ## a)
 
 #define scmd_printk(prefix, scmd, fmt, a...)	\
-	dev_printk(prefix, &(scmd)->device->sdev_gendev, fmt, ##a)
+	sdev_printk(prefix, (scmd)->device, fmt, ##a)
 
 enum scsi_target_state {
 	STARGET_RUNNING = 1,

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

* Re: [PATCH] fix up short inquiry printing
  2006-08-07  2:46 ` Matthew Wilcox
@ 2006-08-07 17:03   ` James Bottomley
  0 siblings, 0 replies; 3+ messages in thread
From: James Bottomley @ 2006-08-07 17:03 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: linux-scsi

On Sun, 2006-08-06 at 20:46 -0600, Matthew Wilcox wrote:
> I think we should probably switch sdev_printk() to its own custom
> implementation rather than just calling dev_printk().  Greg didn't seem
> to be interested in fixing the problem that we have with dev_printk();
> presumably he has some other users in mind for which the current
> dev_printk behaviour is useful.
> 
> How does something like the following look (compile tested):

What issues with dev_printk?  It does make a lot of sense to have a
single tap for errors, just in case someone decides to resurrect the
enterprise logging patches, which would use something like dev_printk as
the discriminator.

James



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

end of thread, other threads:[~2006-08-07 17:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-06 23:15 [PATCH] fix up short inquiry printing James Bottomley
2006-08-07  2:46 ` Matthew Wilcox
2006-08-07 17:03   ` James Bottomley

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