f2fs: fix a bug caused by NULL extent tree
PATCH 1/1 f2fs: fix a bug caused by NULL extent tree
Thread A: Thread B:
-f2fs_remount
-sbi->mount_opt.opt = 0;
<--- -f2fs_iget
-do_read_inode
-f2fs_init_extent_tree
-F2FS_I(inode)->extent_tree is NULL
-default_options && parse_options
-remount return
<--- -f2fs_map_blocks
-f2fs_lookup_extent_tree
-f2fs_bug_on(sbi, !et);The same problem with f2fs_new_inode.
Signed-off-by Yunlei He <[email protected]>
--- fs/f2fs/extent_cache.c | 3 +++ 1 file changed, 3 insertions(+)
fs/f2fs/extent_cache.c +3 -0
@@ -327,6 +327,9 @@ bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext)struct extent_node *en;struct extent_info ei; +if (!test_opt (F2FS_I_SB (inode),EXTENT_CACHE )) +set_inode_flag (inode,FI_NO_EXTENT ); +if (!f2fs_may_extent_tree (inode)) {/* drop largest extent */ if (i_ext && i_ext->len) {
Signature · 6 lines
1.9.1 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot