]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/jffs2/file.c
JFFS2 Fix of panics caused by wrong condition for hole frag creation in write_begin
[karo-tx-linux.git] / fs / jffs2 / file.c
index f9c5dd6f4b64fb77b12b83d7041e6416f2072f41..dcc2734e0b5d65479a34ba53a9bf7ea2f08ecbbf 100644 (file)
@@ -129,7 +129,7 @@ static int jffs2_write_begin(struct file *filp, struct address_space *mapping,
        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);