Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756232Ab0KCR4y (ORCPT ); Wed, 3 Nov 2010 13:56:54 -0400 Received: from mga02.intel.com ([134.134.136.20]:37250 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752903Ab0KCR4w (ORCPT ); Wed, 3 Nov 2010 13:56:52 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.58,289,1286175600"; d="scan'208";a="673957520" Date: Thu, 4 Nov 2010 01:56:49 +0800 From: Wu Fengguang To: Linus Torvalds Cc: Tetsuo Handa , "mrubin@google.com" , "david@fromorbit.com" , "axboe@kernel.dk" , "kosaki.motohiro@jp.fujitsu.com" , "nickpiggin@yahoo.com.au" , "akpm@linux-foundation.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH] vmstat: fix offset calculation on void* Message-ID: <20101103175648.GA6398@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1541 Lines: 46 Fix regression introduced by commit 79da826aee6. BUG: unable to handle kernel paging request at 07c06d16 IP: [] strnlen+0x6/0x20 Call Trace: [] ? string+0x39/0xe0 [] ? __wake_up_common+0x4b/0x80 [] ? vsnprintf+0x1ec/0x380 [] ? seq_printf+0x2e/0x60 [] ? vmstat_show+0x26/0x30 [] ? seq_read+0xa6/0x380 [] ? seq_read+0x0/0x380 [] ? proc_reg_read+0x5f/0x90 [] ? vfs_read+0xa1/0x140 [] ? proc_reg_read+0x0/0x90 [] ? sys_read+0x41/0x70 [] ? sysenter_do_call+0x12/0x26 CC: Tetsuo Handa CC: Michael Rubin Signed-off-by: Wu Fengguang --- Hopefully Tetsuo can test it soon, thanks! mm/vmstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- linux-2.6.orig/mm/vmstat.c 2010-11-04 01:49:12.000000000 +0800 +++ linux-2.6/mm/vmstat.c 2010-11-04 01:49:23.000000000 +0800 @@ -949,7 +949,7 @@ static void *vmstat_start(struct seq_fil 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/