[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <94D0CD8314A33A4D9D801C0FE68B402958BE5A76@G9W0745.americas.hpqcorp.net>
Date: Tue, 12 Aug 2014 14:51:42 +0000
From: "Elliott, Robert (Server Storage)" <Elliott@...com>
To: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@...achi.com>,
Hannes Reinecke <hare@...e.de>
CC: "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
"yrl.pp-manager.tt@...achi.com" <yrl.pp-manager.tt@...achi.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"James E.J. Bottomley" <JBottomley@...allels.com>,
Hidehiro Kawai <hidehiro.kawai.ez@...achi.com>,
Doug Gilbert <dgilbert@...erlog.com>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
Christoph Hellwig <hch@....de>
Subject: RE: [RFC PATCH 01/10] scsi/constants: Cleanup printk message in
__scsi_print_sense()
> -----Original Message-----
> From: linux-scsi-owner@...r.kernel.org [mailto:linux-scsi-
> owner@...r.kernel.org] On Behalf Of Yoshihiro YUNOMAE
> Sent: Friday, 08 August, 2014 6:50 AM
...
> Subject: [RFC PATCH 01/10] scsi/constants: Cleanup printk message in
> __scsi_print_sense()
>
> A device name is output like "sda: Sense Key : Medium Error [current]"
> in __scsi_print_sense(), but it should be "[sda] Sense Key : Medium Error
> [current]" because other printk messages output a device name like "[sda]
> foo."
>
...
> diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
> index c6a7a4a..a0e8159 100644
> --- a/drivers/scsi/constants.c
> +++ b/drivers/scsi/constants.c
> @@ -1470,7 +1470,7 @@ void __scsi_print_sense(struct scsi_device *sdev,
> const char *name,
> return;
> }
>
> - sdev_printk(KERN_INFO, sdev, "%s: Sense Key : %s %s%s\n", name,
> + sdev_printk(KERN_INFO, sdev, "[%s] Sense Key : %s %s%s\n", name,
> scsi_sense_key_string(sshdr.sense_key),
> scsi_sense_type_string(&sshdr),
> scsi_sense_format_string(&sshdr));
>
The callers of __scsi_print_sense do not always pass in a name
like "sda". In fact, sd.c doesn't even call that function; its
sd_print_sense_hdr calls sd_printk (which prints name as "[%s]")
and scsi_show_sense_hdr.
There are just 3 kernel files that call this function:
osst.c: __scsi_print_sense("osst ", SRpnt->sense, SCSI_SENSE_BUFFERSIZE);
osst.c: __scsi_print_sense("osst ", SRpnt->sense, SCSI_SENSE_BUFFERSIZE);
There is a separate call to printk just before each of those,
which prints out the name, without [].
sg.c: __scsi_print_sense(__func__, sense,
That's printing the C function name.
st.c: __scsi_print_sense(name, SRpnt->sense, SCSI_SENSE_BUFFERSIZE);
st.c: __scsi_print_sense(name, SRpnt->sense, SCSI_SENSE_BUFFERSIZE);
This is more like what you have in mind.
---
Rob Elliott HP Server Storage
Powered by blists - more mailing lists