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

From: Wu Fengguang
Date: Wed Nov 03 2010 - 13:46:50 EST


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.

Thanks,
Fengguang
---
diff --git a/mm/vmstat.c b/mm/vmstat.c
index cd2e42b..42eac4d 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -949,7 +949,7 @@ static void *vmstat_start(struct seq_file *m, loff_t *pos)
v[PGPGIN] /= 2; /* sectors -> kbytes */
v[PGPGOUT] /= 2;
#endif
- return m->private + *pos;
+ return (unsigned long *)m->private + *pos;
}

static void *vmstat_next(struct seq_file *m, void *arg, loff_t *pos)
--
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/