]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
f2fs: compress: fix to relocate check condition in f2fs_ioc_{,de}compress_file()
authorChao Yu <chao@kernel.org>
Sun, 7 Apr 2024 07:26:04 +0000 (15:26 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jun 2024 11:39:36 +0000 (13:39 +0200)
commit4f0750bf8a3310e9a7effea9ed021dc8d1655a56
tree04c64590b83348d157d605bd6001a986fd6b98da
parent4eb2124f453a37e2a6101ee6ca435784bfd75ab0
f2fs: compress: fix to relocate check condition in f2fs_ioc_{,de}compress_file()

[ Upstream commit bd9ae4ae9e585061acfd4a169f2321706f900246 ]

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

Fixes: 5fdb322ff2c2 ("f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE")
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