public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lpfc: fix the max value of lpfc_log_verbose
@ 2010-02-01  5:46 Kei Tokunaga
  2010-02-01 13:35 ` James Smart
  0 siblings, 1 reply; 3+ messages in thread
From: Kei Tokunaga @ 2010-02-01  5:46 UTC (permalink / raw)
  To: James Smart; +Cc: James Bottomley, linux-scsi, Kei Tokunaga

Hi,

The max value of lpfc_log_verbose is intended to be 0xffffffff, but since
it was treated as int, 0xffffffff was not actually accepted.  Correcting
it to the actual max value (0x7fffffff)  (Bits up to 18th are defined and
bits up to 15th are actually used today.)

This is the message when tried to store 0xffffffff to lpfc_log_verbose.

  kernel: lpfc 0000:02:03.0: 0:(0):0424 lpfc_log_verbose attribute cannot be set to -1, allowed range is [0x0, 0xffffffff]

Changing its type from 'int' to 'unsigned int' might be another option.

Signed-off-by: Kei Tokunaga <tokunaga.keiich@jp.fujitsu.com>


---

 linux-2.6.33-rc5-v-kei/drivers/scsi/lpfc/lpfc_attr.c   |    2 +-
 linux-2.6.33-rc5-v-kei/drivers/scsi/lpfc/lpfc_logmsg.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/scsi/lpfc/lpfc_attr.c~fix_max_of_log_verbose drivers/scsi/lpfc/lpfc_attr.c
--- linux-2.6.33-rc5-v/drivers/scsi/lpfc/lpfc_attr.c~fix_max_of_log_verbose	2010-01-25 20:23:43.000000000 +0900
+++ linux-2.6.33-rc5-v-kei/drivers/scsi/lpfc/lpfc_attr.c	2010-01-25 20:24:06.000000000 +0900
@@ -2086,7 +2086,7 @@ static DEVICE_ATTR(lpfc_devloss_tmo, S_I
 # You can set a bit mask to record specific types of verbose messages:
 # See lpfc_logmsh.h for definitions.
 */
-LPFC_VPORT_ATTR_HEX_RW(log_verbose, 0x0, 0x0, 0xffffffff,
+LPFC_VPORT_ATTR_HEX_RW(log_verbose, 0x0, 0x0, 0x7fffffff,
 		       "Verbose logging bit-mask");
 
 /*
diff -puN drivers/scsi/lpfc/lpfc_logmsg.h~fix_max_of_log_verbose drivers/scsi/lpfc/lpfc_logmsg.h
--- linux-2.6.33-rc5-v/drivers/scsi/lpfc/lpfc_logmsg.h~fix_max_of_log_verbose	2010-01-25 20:24:24.000000000 +0900
+++ linux-2.6.33-rc5-v-kei/drivers/scsi/lpfc/lpfc_logmsg.h	2010-01-25 20:24:55.000000000 +0900
@@ -35,7 +35,7 @@
 #define LOG_VPORT	0x00004000	/* NPIV events */
 #define LOF_SECURITY	0x00008000	/* Security events */
 #define LOG_EVENT	0x00010000	/* CT,TEMP,DUMP, logging */
-#define LOG_ALL_MSG	0xffffffff	/* LOG all messages */
+#define LOG_ALL_MSG	0x7fffffff	/* LOG all messages */
 
 #define lpfc_printf_vlog(vport, level, mask, fmt, arg...) \
 do { \

_




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

* Re: [PATCH] lpfc: fix the max value of lpfc_log_verbose
  2010-02-01  5:46 [PATCH] lpfc: fix the max value of lpfc_log_verbose Kei Tokunaga
@ 2010-02-01 13:35 ` James Smart
  2010-02-03  4:09   ` Kei Tokunaga
  0 siblings, 1 reply; 3+ messages in thread
From: James Smart @ 2010-02-01 13:35 UTC (permalink / raw)
  To: Kei Tokunaga; +Cc: James Bottomley, linux-scsi@vger.kernel.org

Nack...   I'd rather move it to an unsigned int.  In any case, Emulex will 
take care of this issue in its next patch series.

-- james s


Kei Tokunaga wrote:
> Hi,
> 
> The max value of lpfc_log_verbose is intended to be 0xffffffff, but since
> it was treated as int, 0xffffffff was not actually accepted.  Correcting
> it to the actual max value (0x7fffffff)  (Bits up to 18th are defined and
> bits up to 15th are actually used today.)
> 
> This is the message when tried to store 0xffffffff to lpfc_log_verbose.
> 
>   kernel: lpfc 0000:02:03.0: 0:(0):0424 lpfc_log_verbose attribute cannot be set to -1, allowed range is [0x0, 0xffffffff]
> 
> Changing its type from 'int' to 'unsigned int' might be another option.
> 
> Signed-off-by: Kei Tokunaga <tokunaga.keiich@jp.fujitsu.com>
> 
> 
> ---
> 
>  linux-2.6.33-rc5-v-kei/drivers/scsi/lpfc/lpfc_attr.c   |    2 +-
>  linux-2.6.33-rc5-v-kei/drivers/scsi/lpfc/lpfc_logmsg.h |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff -puN drivers/scsi/lpfc/lpfc_attr.c~fix_max_of_log_verbose drivers/scsi/lpfc/lpfc_attr.c
> --- linux-2.6.33-rc5-v/drivers/scsi/lpfc/lpfc_attr.c~fix_max_of_log_verbose	2010-01-25 20:23:43.000000000 +0900
> +++ linux-2.6.33-rc5-v-kei/drivers/scsi/lpfc/lpfc_attr.c	2010-01-25 20:24:06.000000000 +0900
> @@ -2086,7 +2086,7 @@ static DEVICE_ATTR(lpfc_devloss_tmo, S_I
>  # You can set a bit mask to record specific types of verbose messages:
>  # See lpfc_logmsh.h for definitions.
>  */
> -LPFC_VPORT_ATTR_HEX_RW(log_verbose, 0x0, 0x0, 0xffffffff,
> +LPFC_VPORT_ATTR_HEX_RW(log_verbose, 0x0, 0x0, 0x7fffffff,
>  		       "Verbose logging bit-mask");
>  
>  /*
> diff -puN drivers/scsi/lpfc/lpfc_logmsg.h~fix_max_of_log_verbose drivers/scsi/lpfc/lpfc_logmsg.h
> --- linux-2.6.33-rc5-v/drivers/scsi/lpfc/lpfc_logmsg.h~fix_max_of_log_verbose	2010-01-25 20:24:24.000000000 +0900
> +++ linux-2.6.33-rc5-v-kei/drivers/scsi/lpfc/lpfc_logmsg.h	2010-01-25 20:24:55.000000000 +0900
> @@ -35,7 +35,7 @@
>  #define LOG_VPORT	0x00004000	/* NPIV events */
>  #define LOF_SECURITY	0x00008000	/* Security events */
>  #define LOG_EVENT	0x00010000	/* CT,TEMP,DUMP, logging */
> -#define LOG_ALL_MSG	0xffffffff	/* LOG all messages */
> +#define LOG_ALL_MSG	0x7fffffff	/* LOG all messages */
>  
>  #define lpfc_printf_vlog(vport, level, mask, fmt, arg...) \
>  do { \
> 
> _
> 
> 
> 
> 

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

* Re: [PATCH] lpfc: fix the max value of lpfc_log_verbose
  2010-02-01 13:35 ` James Smart
@ 2010-02-03  4:09   ` Kei Tokunaga
  0 siblings, 0 replies; 3+ messages in thread
From: Kei Tokunaga @ 2010-02-03  4:09 UTC (permalink / raw)
  To: James Smart; +Cc: James Bottomley, linux-scsi@vger.kernel.org, Kei Tokunaga

James Smart wrote:
> Nack...   I'd rather move it to an unsigned int.  In any case, Emulex
> will take care of this issue in its next patch series.

Sure.  That's totally fine with me.  Thanks for taking care of this!

Kei


> -- james s
> 
> 
> Kei Tokunaga wrote:
>> Hi,
>>
>> The max value of lpfc_log_verbose is intended to be 0xffffffff, but since
>> it was treated as int, 0xffffffff was not actually accepted.  Correcting
>> it to the actual max value (0x7fffffff)  (Bits up to 18th are defined and
>> bits up to 15th are actually used today.)
>>
>> This is the message when tried to store 0xffffffff to lpfc_log_verbose.
>>
>>   kernel: lpfc 0000:02:03.0: 0:(0):0424 lpfc_log_verbose attribute
>> cannot be set to -1, allowed range is [0x0, 0xffffffff]
>>
>> Changing its type from 'int' to 'unsigned int' might be another option.
>>
>> Signed-off-by: Kei Tokunaga <tokunaga.keiich@jp.fujitsu.com>
>>
>>
>> ---
>>
>>  linux-2.6.33-rc5-v-kei/drivers/scsi/lpfc/lpfc_attr.c   |    2 +-
>>  linux-2.6.33-rc5-v-kei/drivers/scsi/lpfc/lpfc_logmsg.h |    2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff -puN drivers/scsi/lpfc/lpfc_attr.c~fix_max_of_log_verbose
>> drivers/scsi/lpfc/lpfc_attr.c
>> ---
>> linux-2.6.33-rc5-v/drivers/scsi/lpfc/lpfc_attr.c~fix_max_of_log_verbose   
>> 2010-01-25 20:23:43.000000000 +0900
>> +++ linux-2.6.33-rc5-v-kei/drivers/scsi/lpfc/lpfc_attr.c    2010-01-25
>> 20:24:06.000000000 +0900
>> @@ -2086,7 +2086,7 @@ static DEVICE_ATTR(lpfc_devloss_tmo, S_I
>>  # You can set a bit mask to record specific types of verbose messages:
>>  # See lpfc_logmsh.h for definitions.
>>  */
>> -LPFC_VPORT_ATTR_HEX_RW(log_verbose, 0x0, 0x0, 0xffffffff,
>> +LPFC_VPORT_ATTR_HEX_RW(log_verbose, 0x0, 0x0, 0x7fffffff,
>>                 "Verbose logging bit-mask");
>>  
>>  /*
>> diff -puN drivers/scsi/lpfc/lpfc_logmsg.h~fix_max_of_log_verbose
>> drivers/scsi/lpfc/lpfc_logmsg.h
>> ---
>> linux-2.6.33-rc5-v/drivers/scsi/lpfc/lpfc_logmsg.h~fix_max_of_log_verbose   
>> 2010-01-25 20:24:24.000000000 +0900
>> +++ linux-2.6.33-rc5-v-kei/drivers/scsi/lpfc/lpfc_logmsg.h   
>> 2010-01-25 20:24:55.000000000 +0900
>> @@ -35,7 +35,7 @@
>>  #define LOG_VPORT    0x00004000    /* NPIV events */
>>  #define LOF_SECURITY    0x00008000    /* Security events */
>>  #define LOG_EVENT    0x00010000    /* CT,TEMP,DUMP, logging */
>> -#define LOG_ALL_MSG    0xffffffff    /* LOG all messages */
>> +#define LOG_ALL_MSG    0x7fffffff    /* LOG all messages */
>>  
>>  #define lpfc_printf_vlog(vport, level, mask, fmt, arg...) \
>>  do { \
>>
>> _
>>
>>
>>
>>
> 
> 


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

end of thread, other threads:[~2010-02-03  4:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-01  5:46 [PATCH] lpfc: fix the max value of lpfc_log_verbose Kei Tokunaga
2010-02-01 13:35 ` James Smart
2010-02-03  4:09   ` Kei Tokunaga

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