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 CC: Benjamin Herrenschmidt CC: Christoph Lameter CC: Ingo Molnar CC: Tejun Heo CC: Nick Piggin CC: KAMEZAWA Hiroyuki CC: Signed-off-by: Wu Fengguang --- drivers/char/mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- linux-mm.orig/drivers/char/mem.c 2010-01-11 10:32:32.000000000 +0800 +++ linux-mm/drivers/char/mem.c 2010-01-11 10:32:34.000000000 +0800 @@ -555,7 +555,7 @@ static ssize_t write_kmem(struct file * err = -EFAULT; break; } - sz = vwrite(kbuf, (char *)p, sz); + vwrite(kbuf, (char *)p, sz); count -= sz; buf += sz; virtr += sz; -- 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/