Re: [2.6.37-rc1] /proc/vmstat failure.

From: Wu Fengguang
Date: Wed Nov 03 2010 - 22:21:11 EST


On Thu, Nov 04, 2010 at 05:54:48AM +0800, Tetsuo Handa wrote:
> Wu Fengguang wrote:
> > On Wed, Nov 03, 2010 at 07:11:11PM +0800, Tetsuo Handa wrote:
> > > Hello.
> > >
> > > "cat /proc/vmstat" triggered below failure.
> > >
> > > BUG: unable to handle kernel paging request at 07c06d16
> > > IP: [<c050c336>] strnlen+0x6/0x20
> >
> > It seems that m->private is of type (void *) while the original v is
> > (unsigned long *). Can be fixed by the following patch.
>
> Fixed by this patch. Thank you.

Great, thanks!

> By the way, GCC treats "(void *) + offset" as "(char *) + offset"
> but it is GCC specific extention. Maybe we should avoid such usage
> in order to avoid build failure for other compilers.

"(void *) + offset" seems to be used quite often.

I tried enable this gcc option, only to see huge amount of warnings.

-Wpointer-arith
Warn about anything that depends on the "size of" a
function type or of "void". GNU C assigns these types a
size of 1, for convenience in calculations with "void *"
pointers and pointers to functions.

/cc/linux-next/scripts/mod/file2alias.c: In function âdevice_id_checkâ:
/cc/linux-next/scripts/mod/file2alias.c:88: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/file2alias.c:88: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/file2alias.c:88: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/file2alias.c:94: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/file2alias.c:94: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/file2alias.c:94: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/file2alias.c: In function âdo_usb_tableâ:
/cc/linux-next/scripts/mod/file2alias.c:275: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/file2alias.c: In function âdo_tableâ:
/cc/linux-next/scripts/mod/file2alias.c:870: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/file2alias.c: In function âhandle_moddevtableâ:
/cc/linux-next/scripts/mod/file2alias.c:897: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/file2alias.c:897: warning: pointer of type âvoid *â used in arithmetic
HOSTCC scripts/mod/modpost.o
/cc/linux-next/scripts/mod/modpost.c: In function âparse_elfâ:
/cc/linux-next/scripts/mod/modpost.c:412: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/modpost.c:456: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/modpost.c:472: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/modpost.c:489: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/modpost.c:491: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/modpost.c:491: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/modpost.c:494: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/modpost.c:501: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/modpost.c:503: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/modpost.c:503: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/modpost.c: In function âsec_nameâ:
/cc/linux-next/scripts/mod/modpost.c:716: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/modpost.c:717: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/modpost.c: In function âsech_nameâ:
/cc/linux-next/scripts/mod/modpost.c:723: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/modpost.c:724: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/modpost.c: In function âreloc_locationâ:
/cc/linux-next/scripts/mod/modpost.c:1443: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/modpost.c:1444: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/modpost.c:1444: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/modpost.c: In function âsection_relaâ:
/cc/linux-next/scripts/mod/modpost.c:1520: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/modpost.c:1521: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/modpost.c: In function âsection_relâ:
/cc/linux-next/scripts/mod/modpost.c:1564: warning: pointer of type âvoid *â used in arithmetic
/cc/linux-next/scripts/mod/modpost.c:1565: warning: pointer of type âvoid *â used in arithmetic

Thanks,
Fengguang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/