From: Andrew Morton Date: Sat, 5 Jul 2008 08:02:01 +0000 (-0700) Subject: Fix pagemap_read() use of struct mm_walk X-Git-Tag: v2.6.26-rc9~1 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=5d7e0d2bd98ef4f5a16ac9da1987ae655368dd6a;hp=5d7e0d2bd98ef4f5a16ac9da1987ae655368dd6a;ds=sidebyside Fix pagemap_read() use of struct mm_walk Fix some issues in pagemap_read noted by Alexey: - initialize pagemap_walk.mm to "mm" , so the code starts working as advertised - initialize ->private to "&pm" so it wouldn't immediately oops in pagemap_pte_hole() - unstatic struct pagemap_walk, so two threads won't fsckup each other (including those started by root, including flipping ->mm when you don't have permissions) - pagemap_read() contains two calls to ptrace_may_attach(), second one looks unneeded. - avoid possible kmalloc(0) and integer wraparound. Cc: Alexey Dobriyan Cc: Matt Mackall Signed-off-by: Andrew Morton [ Personally, I'd just remove the functionality entirely - Linus ] Signed-off-by: Linus Torvalds ---