diff options
author | Chao Yu <chao@kernel.org> | 2023-05-17 11:41:39 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2023-06-26 06:07:09 -0700 |
commit | 64ee9163fe1b911aa0476af06ee0afd23fdf7388 (patch) | |
tree | bb65a743bfa7acc8004351b72450bd3709af076a /fs/f2fs | |
parent | 698a5c8c8e05590d92629ad5796a421e14218e20 (diff) |
f2fs: compress: fix to check validity of i_compress_flag field
The last valid compress related field is i_compress_flag, check its
validity instead of i_log_cluster_size.
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/inode.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index bb6c3733d104..6cacc8c55dec 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -362,7 +362,7 @@ static bool sanity_check_inode(struct inode *inode, struct page *node_page) if (f2fs_has_extra_attr(inode) && f2fs_sb_has_compression(sbi) && fi->i_flags & F2FS_COMPR_FL && F2FS_FITS_IN_INODE(ri, fi->i_extra_isize, - i_log_cluster_size)) + i_compress_flag)) return sanity_check_compress_inode(inode, ri); return true; @@ -491,7 +491,7 @@ static int do_read_inode(struct inode *inode) if (f2fs_has_extra_attr(inode) && f2fs_sb_has_compression(sbi) && (fi->i_flags & F2FS_COMPR_FL)) { if (F2FS_FITS_IN_INODE(ri, fi->i_extra_isize, - i_log_cluster_size)) { + i_compress_flag)) { unsigned short compress_flag; atomic_set(&fi->i_compr_blocks, @@ -729,7 +729,7 @@ void f2fs_update_inode(struct inode *inode, struct page *node_page) if (f2fs_sb_has_compression(F2FS_I_SB(inode)) && F2FS_FITS_IN_INODE(ri, F2FS_I(inode)->i_extra_isize, - i_log_cluster_size)) { + i_compress_flag)) { unsigned short compress_flag; ri->i_compr_blocks = |