Re: [RFC PATCH 01/10] scsi/constants: Cleanup printk message in __scsi_print_sense()

2014-08-27 Thread Hannes Reinecke

On 08/08/2014 01:50 PM, Yoshihiro YUNOMAE wrote:

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.

Signed-off-by: Yoshihiro YUNOMAE yoshihiro.yunomae...@hitachi.com
Cc: Hannes Reinecke h...@suse.de
Cc: Doug Gilbert dgilb...@interlog.com
Cc: Martin K. Petersen martin.peter...@oracle.com
Cc: Christoph Hellwig h...@lst.de
Cc: James E.J. Bottomley jbottom...@parallels.com
Cc: Hidehiro Kawai hidehiro.kawai...@hitachi.com
Cc: Masami Hiramatsu masami.hiramatsu...@hitachi.com
---
  drivers/scsi/constants.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

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));

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A similar fix is already present in my next version of the scsi 
logging patchset.


Cheers,

Hannes
--
Dr. Hannes Reinecke   zSeries  Storage
h...@suse.de  +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [RFC PATCH 01/10] scsi/constants: Cleanup printk message in __scsi_print_sense()

2014-08-12 Thread Elliott, Robert (Server Storage)


 -Original Message-
 From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi-
 ow...@vger.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 ElliottHP Server Storage


N�r��yb�X��ǧv�^�)޺{.n�+{{ay�ʇڙ�,j��f���h���z��w���
���j:+v���w�j�mzZ+�ݢj��!�i

Re: [RFC PATCH 01/10] scsi/constants: Cleanup printk message in __scsi_print_sense()

2014-08-12 Thread Yoshihiro YUNOMAE

Hi Elliot,

Thank you for your comment.

(2014/08/12 23:51), Elliott, Robert (Server Storage) wrote:




-Original Message-
From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi-
ow...@vger.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.


OK, I understood.
Current Linux kernel also outputs name: in __scsi_print_sense(),
so we should not change this.

Thanks,
Yoshihiro YUNOMOAE

--
Yoshihiro YUNOMAE
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: yoshihiro.yunomae...@hitachi.com


--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html