]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
f2fs: compress: fix to relocate check condition in f2fs_{release,reserve}_compress_bl...
authorChao Yu <chao@kernel.org>
Sun, 7 Apr 2024 07:26:03 +0000 (15:26 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jun 2024 11:39:36 +0000 (13:39 +0200)
commit84908c23a90eafac8ef449f81052144d56de0ecd
treedc72a447d114a08685f8d27e7a1f1841c3214bbd
parenteeabb84d796e69a81620913183e698ed777e59d9
f2fs: compress: fix to relocate check condition in f2fs_{release,reserve}_compress_blocks()

[ Upstream commit 7c5dffb3d90c5921b91981cc663e02757d90526e ]

Compress flag should be checked after inode lock held to avoid
racing w/ f2fs_setflags_common(), fix it.

Fixes: 4c8ff7095bef ("f2fs: support data compression")
Reported-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
Closes: https://lore.kernel.org/linux-f2fs-devel/CAHJ8P3LdZXLc2rqeYjvymgYHr2+YLuJ0sLG9DdsJZmwO7deuhw@mail.gmail.com
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/file.c