Re: [f2fs-dev] [PATCH V2 1/2] f2fs: compress: relocate some judgments in f2fs_reserve_compress_blocks
Hello: This series was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim : On Wed, 6 Mar 2024 11:47:45 +0800 you wrote: > The following f2fs_io test will get a "0" result instead of -EINVAL, > unisoc # ./f2fs_io compress file > unisoc # ./f2fs_io reserve_cblocks file > 0 > it's not reasonable, so the judgement of > atomic_read(_I(inode)->i_compr_blocks) should be placed after > the judgement of is_inode_flag_set(inode, FI_COMPRESS_RELEASED). > > [...] Here is the summary with links: - [f2fs-dev,V2,1/2] f2fs: compress: relocate some judgments in f2fs_reserve_compress_blocks https://git.kernel.org/jaegeuk/f2fs/c/b7d797d241c1 - [f2fs-dev,V2,2/2] f2fs: compress: fix reserve_cblocks counting error when out of space https://git.kernel.org/jaegeuk/f2fs/c/2f6d721e14b6 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Re: [f2fs-dev] [PATCH V2 1/2] f2fs: compress: relocate some judgments in f2fs_reserve_compress_blocks
On 2024/3/6 11:47, Xiuhong Wang wrote: The following f2fs_io test will get a "0" result instead of -EINVAL, unisoc # ./f2fs_io compress file unisoc # ./f2fs_io reserve_cblocks file 0 it's not reasonable, so the judgement of atomic_read(_I(inode)->i_compr_blocks) should be placed after the judgement of is_inode_flag_set(inode, FI_COMPRESS_RELEASED). Fixes: c75488fb4d82 ("f2fs: introduce F2FS_IOC_RESERVE_COMPRESS_BLOCKS") Signed-off-by: Xiuhong Wang Signed-off-by: Zhiguo Niu Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
[f2fs-dev] [PATCH V2 1/2] f2fs: compress: relocate some judgments in f2fs_reserve_compress_blocks
The following f2fs_io test will get a "0" result instead of -EINVAL, unisoc # ./f2fs_io compress file unisoc # ./f2fs_io reserve_cblocks file 0 it's not reasonable, so the judgement of atomic_read(_I(inode)->i_compr_blocks) should be placed after the judgement of is_inode_flag_set(inode, FI_COMPRESS_RELEASED). Fixes: c75488fb4d82 ("f2fs: introduce F2FS_IOC_RESERVE_COMPRESS_BLOCKS") Signed-off-by: Xiuhong Wang Signed-off-by: Zhiguo Niu --- fs/f2fs/file.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 4ca6c693b33a..74c5e48fce22 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -3720,9 +3720,6 @@ static int f2fs_reserve_compress_blocks(struct file *filp, unsigned long arg) if (ret) return ret; - if (atomic_read(_I(inode)->i_compr_blocks)) - goto out; - f2fs_balance_fs(sbi, true); inode_lock(inode); @@ -3732,6 +3729,9 @@ static int f2fs_reserve_compress_blocks(struct file *filp, unsigned long arg) goto unlock_inode; } + if (atomic_read(_I(inode)->i_compr_blocks)) + goto unlock_inode; + f2fs_down_write(_I(inode)->i_gc_rwsem[WRITE]); filemap_invalidate_lock(inode->i_mapping); @@ -3778,7 +3778,6 @@ static int f2fs_reserve_compress_blocks(struct file *filp, unsigned long arg) } unlock_inode: inode_unlock(inode); -out: mnt_drop_write_file(filp); if (ret >= 0) { -- 2.25.1 ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel