]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Revert "jffs2: Fix possible null-pointer dereferences in jffs2_add_frag_to_fragtree()"
authorJoel Stanley <joel@jms.id.au>
Fri, 29 Nov 2019 00:19:30 +0000 (10:49 +1030)
committerRichard Weinberger <richard@nod.at>
Fri, 29 Nov 2019 10:29:58 +0000 (11:29 +0100)
This reverts commit f2538f999345405f7d2e1194c0c8efa4e11f7b3a. The patch
stopped JFFS2 from being able to mount an existing filesystem with the
following errors:

 jffs2: error: (77) jffs2_build_inode_fragtree: Add node to tree failed -22
 jffs2: error: (77) jffs2_do_read_inode_internal: Failed to build final fragtree for inode #5377: error -22

Fixes: f2538f999345 ("jffs2: Fix possible null-pointer dereferences...")
Cc: stable@vger.kernel.org
Suggested-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/jffs2/nodelist.c

index 021a4a2190eeb2a1500610b1f8e74a09e83787c4..b86c78d178c60a3af10f6ae4c688d6acce8f8dbf 100644 (file)
@@ -226,7 +226,7 @@ static int jffs2_add_frag_to_fragtree(struct jffs2_sb_info *c, struct rb_root *r
                lastend = this->ofs + this->size;
        } else {
                dbg_fragtree2("lookup gave no frag\n");
-               return -EINVAL;
+               lastend = 0;
        }
 
        /* See if we ran off the end of the fragtree */