• Jaegeuk Kim's avatar
    f2fs: convert inline_data in prior to i_size_write · cfb9a34d
    Jaegeuk Kim authored
    In below call path, we change i_size before inline conversion, however,
    if we failed to convert inline inode, the inode may have wrong i_size
    which is larger than max inline size, result inline inode corruption.
    
    - f2fs_setattr
     - truncate_setsize
     - f2fs_convert_inline_inode
    
    This patch reorders truncate_setsize() and f2fs_convert_inline_inode()
    to guarantee inline_data has valid i_size.
    
    Fixes: 0cab80ee ("f2fs: fix to convert inline inode in ->setattr")
    Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
    Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    cfb9a34d
file.c 78.3 KB