Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-10 Thread Tejun Heo
Hello, Joe. On Thu, Sep 10, 2015 at 08:41:25AM -0700, Joe Perches wrote: > On Thu, 2015-09-10 at 10:36 -0400, Tejun Heo wrote: > > On Wed, Sep 09, 2015 at 12:26:39PM -0700, Joe Perches wrote: > > > > > %*pb is meant for smallish bitmaps, not big ones. > [] > > The use case isn't from me, but why

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-10 Thread Joe Perches
On Thu, 2015-09-10 at 10:36 -0400, Tejun Heo wrote: > On Wed, Sep 09, 2015 at 12:26:39PM -0700, Joe Perches wrote: > > > > %*pb is meant for smallish bitmaps, not big ones. [] > The use case isn't from me, but why not? Imagine the output of the 500k bitmap if every other bit is set. %*pb isn't

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-10 Thread Tejun Heo
Hello, On Thu, Sep 10, 2015 at 01:17:36AM -0700, Joe Perches wrote: > > It also won't work for the case at hand if/when the actual bitmap ever > > gets a bit set beyond S16_MAX. > > But at least it should work for the bitmap sized <= S16_MAX > which should be the majority of uses. The failure

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-10 Thread Tejun Heo
Hello, Joe. On Wed, Sep 09, 2015 at 12:26:39PM -0700, Joe Perches wrote: > > > %*pb is meant for smallish bitmaps, not big ones. I'm not so sure about that. It's one thing to truncate printk output cuz the actual formatted result is too long but crippling the entire printf family of functions

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-10 Thread Maurizio Lombardi
On 09/10/2015 09:38 AM, Joe Perches wrote:ing will be printed. > > Maurizio, did you try the patch I posted? > I think it'll work, but it doesn't fix the > fundamental issue of %*pbl with large bitmaps. I tested your patch, it works for the simple cases where bits are set below the S16_MAX

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-10 Thread Joe Perches
On Thu, 2015-09-10 at 09:56 +0200, Rasmus Villemoes wrote: > On Thu, Sep 10 2015, Joe Perches wrote: > > On Thu, 2015-09-10 at 09:04 +0200, Maurizio Lombardi wrote: > >> On 09/09/2015 08:51 PM, Rasmus Villemoes wrote: > >> > I'm also a little confused; I don't see what printk has to do with the >

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-10 Thread Rasmus Villemoes
On Thu, Sep 10 2015, Joe Perches wrote: > On Thu, 2015-09-10 at 09:04 +0200, Maurizio Lombardi wrote: >> Hi Rasmus, >> >> On 09/09/2015 08:51 PM, Rasmus Villemoes wrote: >> > I'm also a little confused; I don't see what printk has to do with the >> > reported problem (I'd expect the /sys/...

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-10 Thread Joe Perches
On Thu, 2015-09-10 at 09:04 +0200, Maurizio Lombardi wrote: > Hi Rasmus, > > On 09/09/2015 08:51 PM, Rasmus Villemoes wrote: > > I'm also a little confused; I don't see what printk has to do with the > > reported problem (I'd expect the /sys/... file to be generated by > > something like

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-10 Thread Maurizio Lombardi
On 09/10/2015 09:04 AM, Maurizio Lombardi wrote: > > scsi-debug used the bitmap_scnlistprintf() function but since commit > dbc760bcc150cc27160f0131b15db76350df4334 this function is just a wrapper > around scnprintf("%*pbl"); I just want to add that since commit

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-10 Thread Maurizio Lombardi
Hi Rasmus, On 09/09/2015 08:51 PM, Rasmus Villemoes wrote: > I'm also a little confused; I don't see what printk has to do with the > reported problem (I'd expect the /sys/... file to be generated by > something like seq_printf). In the scsi-debug case scnprintf is used, but it doesn't really

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-10 Thread Maurizio Lombardi
On 09/10/2015 09:38 AM, Joe Perches wrote:ing will be printed. > > Maurizio, did you try the patch I posted? > I think it'll work, but it doesn't fix the > fundamental issue of %*pbl with large bitmaps. I tested your patch, it works for the simple cases where bits are set below the S16_MAX

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-10 Thread Joe Perches
On Thu, 2015-09-10 at 09:04 +0200, Maurizio Lombardi wrote: > Hi Rasmus, > > On 09/09/2015 08:51 PM, Rasmus Villemoes wrote: > > I'm also a little confused; I don't see what printk has to do with the > > reported problem (I'd expect the /sys/... file to be generated by > > something like

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-10 Thread Joe Perches
On Thu, 2015-09-10 at 09:56 +0200, Rasmus Villemoes wrote: > On Thu, Sep 10 2015, Joe Perches wrote: > > On Thu, 2015-09-10 at 09:04 +0200, Maurizio Lombardi wrote: > >> On 09/09/2015 08:51 PM, Rasmus Villemoes wrote: > >> > I'm also a little confused; I don't see what printk

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-10 Thread Maurizio Lombardi
On 09/10/2015 09:04 AM, Maurizio Lombardi wrote: > > scsi-debug used the bitmap_scnlistprintf() function but since commit > dbc760bcc150cc27160f0131b15db76350df4334 this function is just a wrapper > around scnprintf("%*pbl"); I just want to add that since commit

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-10 Thread Maurizio Lombardi
Hi Rasmus, On 09/09/2015 08:51 PM, Rasmus Villemoes wrote: > I'm also a little confused; I don't see what printk has to do with the > reported problem (I'd expect the /sys/... file to be generated by > something like seq_printf). In the scsi-debug case scnprintf is used, but it doesn't really

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-10 Thread Rasmus Villemoes
On Thu, Sep 10 2015, Joe Perches wrote: > On Thu, 2015-09-10 at 09:04 +0200, Maurizio Lombardi wrote: >> Hi Rasmus, >> >> On 09/09/2015 08:51 PM, Rasmus Villemoes wrote: >> > I'm also a little confused; I don't see what printk has to do with the >> > reported problem (I'd

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-10 Thread Joe Perches
On Thu, 2015-09-10 at 10:36 -0400, Tejun Heo wrote: > On Wed, Sep 09, 2015 at 12:26:39PM -0700, Joe Perches wrote: > > > > %*pb is meant for smallish bitmaps, not big ones. [] > The use case isn't from me, but why not? Imagine the output of the 500k bitmap if every other bit is set. %*pb isn't

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-10 Thread Tejun Heo
Hello, Joe. On Wed, Sep 09, 2015 at 12:26:39PM -0700, Joe Perches wrote: > > > %*pb is meant for smallish bitmaps, not big ones. I'm not so sure about that. It's one thing to truncate printk output cuz the actual formatted result is too long but crippling the entire printf family of functions

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-10 Thread Tejun Heo
Hello, On Thu, Sep 10, 2015 at 01:17:36AM -0700, Joe Perches wrote: > > It also won't work for the case at hand if/when the actual bitmap ever > > gets a bit set beyond S16_MAX. > > But at least it should work for the bitmap sized <= S16_MAX > which should be the majority of uses. The failure

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-10 Thread Tejun Heo
Hello, Joe. On Thu, Sep 10, 2015 at 08:41:25AM -0700, Joe Perches wrote: > On Thu, 2015-09-10 at 10:36 -0400, Tejun Heo wrote: > > On Wed, Sep 09, 2015 at 12:26:39PM -0700, Joe Perches wrote: > > > > > %*pb is meant for smallish bitmaps, not big ones. > [] > > The use case isn't from me, but why

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-09 Thread Joe Perches
On Wed, 2015-09-09 at 20:51 +0200, Rasmus Villemoes wrote: > On Wed, Sep 09 2015, Joe Perches wrote: > > this makes the sizeof struct printf_spec more than > > 8 bytes which isn't desireable on x86-32. > > I'm pretty sure struct printf_spec > purposely has sizeof==8 to allow it to be (relatively

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-09 Thread Rasmus Villemoes
On Wed, Sep 09 2015, Joe Perches wrote: > On Wed, 2015-09-09 at 12:13 +0200, Maurizio Lombardi wrote: >> When printing a bitmap using the "%*pb[l]" printk format >> a 16 bit variable (field_width) is used to store the size of the bitmap. >> In some cases 16 bits are not sufficient, the variable

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-09 Thread Joe Perches
On Wed, 2015-09-09 at 12:36 -0400, Tejun Heo wrote: > On Wed, Sep 09, 2015 at 09:33:52AM -0700, Joe Perches wrote: > > On Wed, 2015-09-09 at 12:13 +0200, Maurizio Lombardi wrote: > > > When printing a bitmap using the "%*pb[l]" printk format > > > a 16 bit variable (field_width) is used to store

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-09 Thread Tejun Heo
Hello, On Wed, Sep 09, 2015 at 09:33:52AM -0700, Joe Perches wrote: > On Wed, 2015-09-09 at 12:13 +0200, Maurizio Lombardi wrote: > > When printing a bitmap using the "%*pb[l]" printk format > > a 16 bit variable (field_width) is used to store the size of the bitmap. > > In some cases 16 bits are

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-09 Thread Joe Perches
On Wed, 2015-09-09 at 12:13 +0200, Maurizio Lombardi wrote: > When printing a bitmap using the "%*pb[l]" printk format > a 16 bit variable (field_width) is used to store the size of the bitmap. > In some cases 16 bits are not sufficient, the variable overflows and > printk does not work as

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-09 Thread Tejun Heo
On Wed, Sep 09, 2015 at 12:13:10PM +0200, Maurizio Lombardi wrote: > When printing a bitmap using the "%*pb[l]" printk format > a 16 bit variable (field_width) is used to store the size of the bitmap. > In some cases 16 bits are not sufficient, the variable overflows and > printk does not work as

[PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-09 Thread Maurizio Lombardi
When printing a bitmap using the "%*pb[l]" printk format a 16 bit variable (field_width) is used to store the size of the bitmap. In some cases 16 bits are not sufficient, the variable overflows and printk does not work as expected. This patch fixes the problem by changing the type of field_width

[PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-09 Thread Maurizio Lombardi
When printing a bitmap using the "%*pb[l]" printk format a 16 bit variable (field_width) is used to store the size of the bitmap. In some cases 16 bits are not sufficient, the variable overflows and printk does not work as expected. This patch fixes the problem by changing the type of field_width

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-09 Thread Tejun Heo
On Wed, Sep 09, 2015 at 12:13:10PM +0200, Maurizio Lombardi wrote: > When printing a bitmap using the "%*pb[l]" printk format > a 16 bit variable (field_width) is used to store the size of the bitmap. > In some cases 16 bits are not sufficient, the variable overflows and > printk does not work as

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-09 Thread Rasmus Villemoes
On Wed, Sep 09 2015, Joe Perches wrote: > On Wed, 2015-09-09 at 12:13 +0200, Maurizio Lombardi wrote: >> When printing a bitmap using the "%*pb[l]" printk format >> a 16 bit variable (field_width) is used to store the size of the bitmap. >> In some cases 16 bits are not

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-09 Thread Tejun Heo
Hello, On Wed, Sep 09, 2015 at 09:33:52AM -0700, Joe Perches wrote: > On Wed, 2015-09-09 at 12:13 +0200, Maurizio Lombardi wrote: > > When printing a bitmap using the "%*pb[l]" printk format > > a 16 bit variable (field_width) is used to store the size of the bitmap. > > In some cases 16 bits are

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-09 Thread Joe Perches
On Wed, 2015-09-09 at 12:13 +0200, Maurizio Lombardi wrote: > When printing a bitmap using the "%*pb[l]" printk format > a 16 bit variable (field_width) is used to store the size of the bitmap. > In some cases 16 bits are not sufficient, the variable overflows and > printk does not work as

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-09 Thread Joe Perches
On Wed, 2015-09-09 at 12:36 -0400, Tejun Heo wrote: > On Wed, Sep 09, 2015 at 09:33:52AM -0700, Joe Perches wrote: > > On Wed, 2015-09-09 at 12:13 +0200, Maurizio Lombardi wrote: > > > When printing a bitmap using the "%*pb[l]" printk format > > > a 16 bit variable (field_width) is used to store

Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable

2015-09-09 Thread Joe Perches
On Wed, 2015-09-09 at 20:51 +0200, Rasmus Villemoes wrote: > On Wed, Sep 09 2015, Joe Perches wrote: > > this makes the sizeof struct printf_spec more than > > 8 bytes which isn't desireable on x86-32. > > I'm pretty sure struct printf_spec > purposely has sizeof==8 to allow it