]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: fix to enable compress for newly created file if extension matches
authorSheng Yong <shengyong@oppo.com>
Fri, 11 Nov 2022 10:08:29 +0000 (18:08 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:36 +0000 (13:32 +0100)
commitd9ff34d1679380260cb61f7791fcf0d5c587d4f9
tree590e8ed583989362c49d316c7ffde407f8d4fe40
parent41b1fb5366e81ad5fe48dc5a83b1a9a42edf3573
f2fs: fix to enable compress for newly created file if extension matches

[ Upstream commit 5766a2ffb256538c320397b55865a3a634170529 ]

If compress_extension is set, and a newly created file matches the
extension, the file could be marked as compression file. However,
if inline_data is also enabled, there is no chance to check its
extension since f2fs_should_compress() always returns false.

This patch moves set_compress_inode(), which do extension check, in
f2fs_should_compress() to check extensions before setting inline
data flag.

Fixes: 23d7d02bf90d ("f2fs: fix to check inline_data during compressed inode conversion")
Signed-off-by: Sheng Yong <shengyong@oppo.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/f2fs.h
fs/f2fs/namei.c