The patch titled jffs2: fix panics caused by wrong condition for hole frag creation in write_begin has been added to the -mm tree. Its filename is jffs2-fix-panics-caused-by-wrong-condition-for-hole-frag-creation-in-write_begin.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: jffs2: fix panics caused by wrong condition for hole frag creation in write_begin From: Alexey Korolev <akorolev@xxxxxxxxxxxxx> This fixes a regression introduced in commit 205c109a7a96d9a3d8ffe64c4068b70811fef5e8 when switching to write_begin/write_end operations in JFFS2. The page offset is miscalculated, leading to corruption of the fragment lists and subsequently to memory corruption and panics. Signed-off-by: Alexey Korolev <akorolev@xxxxxxxxxxxxx> Signed-off-by: Vasiliy Leonenko <vasiliy.leonenko@xxxxxxx> Signed-off-by: David Woodhouse <dwmw2@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/jffs2/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN fs/jffs2/file.c~jffs2-fix-panics-caused-by-wrong-condition-for-hole-frag-creation-in-write_begin fs/jffs2/file.c --- a/fs/jffs2/file.c~jffs2-fix-panics-caused-by-wrong-condition-for-hole-frag-creation-in-write_begin +++ a/fs/jffs2/file.c @@ -129,7 +129,7 @@ static int jffs2_write_begin(struct file struct inode *inode = mapping->host; struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); pgoff_t index = pos >> PAGE_CACHE_SHIFT; - uint32_t pageofs = pos & (PAGE_CACHE_SIZE - 1); + uint32_t pageofs = index << PAGE_CACHE_SHIFT; int ret = 0; pg = __grab_cache_page(mapping, index); _ Patches currently in -mm which might be from akorolev@xxxxxxxxxxxxx are jffs2-fix-panics-caused-by-wrong-condition-for-hole-frag-creation-in-write_begin.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html