[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100204024353.GA13576@localhost>
Date: Thu, 4 Feb 2010 10:43:54 +0800
From: Wu Fengguang <fengguang.wu@...el.com>
To: Greg KH <greg@...ah.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...e.de>,
LKML <linux-kernel@...r.kernel.org>,
Linux Memory Management List <linux-mm@...ck.org>,
Andi Kleen <andi@...stfloor.org>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"stable@...nel.org" <stable@...nel.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Subject: [stable] [PATCH] devmem: fix kmem write bug on memory holes
From: Wu Fengguang <fengguang.wu@...el.com>
commit c85e9a97c4102ce2e83112da850d838cfab5ab13 upstream.
write_kmem() used to assume vwrite() always return the full buffer length.
However now vwrite() could return 0 to indicate memory hole. This creates
a bug that "buf" is not advanced accordingly.
Fix it to simply ignore the return value, hence the memory hole.
CC: Andi Kleen <andi@...stfloor.org>
CC: Benjamin Herrenschmidt <benh@...nel.crashing.org>
CC: Christoph Lameter <cl@...ux-foundation.org>
CC: Ingo Molnar <mingo@...e.hu>
CC: Tejun Heo <tj@...nel.org>
CC: Nick Piggin <npiggin@...e.de>
CC: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
CC: <stable@...nel.org>
Signed-off-by: Wu Fengguang <fengguang.wu@...el.com>
---
drivers/char/mem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-2.6.32.orig/drivers/char/mem.c 2010-02-04 10:37:55.000000000 +0800
+++ linux-2.6.32/drivers/char/mem.c 2010-02-04 10:37:59.000000000 +0800
@@ -599,7 +599,7 @@ static ssize_t write_kmem(struct file *
break;
}
}
- len = vwrite(kbuf, (char *)p, len);
+ vwrite(kbuf, (char *)p, len);
count -= len;
buf += len;
virtr += len;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists