OSDN Git Service

f2fs: fix a bug caused by NULL extent tree
authorYunlei He <heyunlei@huawei.com>
Fri, 19 May 2017 07:06:12 +0000 (15:06 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Mar 2018 09:23:20 +0000 (10:23 +0100)
commit4a97b2d09d332c43612f489c99b97d691002b6d4
tree187b3eaf175ee365417ad95ce210f9984224646b
parentb4e0649eeb65c556d01de986a589da2ffd5c2029
f2fs: fix a bug caused by NULL extent tree

commit dad48e73127ba10279ea33e6dbc8d3905c4d31c0 upstream.

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 <heyunlei@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/f2fs/extent_cache.c