lkml.org 
[lkml]   [2018]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.9 03/56] f2fs: fix a bug caused by NULL extent tree
    Date
    4.9-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Yunlei He <heyunlei@huawei.com>

    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 | 12 +++++++++++-
    1 file changed, 11 insertions(+), 1 deletion(-)

    --- a/fs/f2fs/extent_cache.c
    +++ b/fs/f2fs/extent_cache.c
    @@ -177,7 +177,7 @@ static void __drop_largest_extent(struct
    }

    /* return true, if inode page is changed */
    -bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext)
    +static bool __f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext)
    {
    struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
    struct extent_tree *et;
    @@ -215,6 +215,16 @@ out:
    return false;
    }

    +bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext)
    +{
    + bool ret = __f2fs_init_extent_tree(inode, i_ext);
    +
    + if (!F2FS_I(inode)->extent_tree)
    + set_inode_flag(inode, FI_NO_EXTENT);
    +
    + return ret;
    +}
    +
    static bool f2fs_lookup_extent_tree(struct inode *inode, pgoff_t pgofs,
    struct extent_info *ei)
    {

    \
     
     \ /
      Last update: 2018-03-02 11:59    [W:5.133 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site