]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
f2fs: compress: disallow disabling compress on non-empty compressed file
authorHyeong-Jun Kim <hj514.kim@samsung.com>
Wed, 27 Oct 2021 04:16:00 +0000 (13:16 +0900)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 7 Dec 2021 06:34:05 +0000 (07:34 +0100)
commit1f26d8a854100fe1b5b5f01dfe6c29c4641cae67
treed95bdb46893a42c5a710563a52ec31d3ef1e8d7a
parent22cb5739a31e92ce4ae3c6bb911b6302288242ea
f2fs: compress: disallow disabling compress on non-empty compressed file

BugLink: https://bugs.launchpad.net/bugs/1952579
[ Upstream commit 02d58cd253d7536c412993573fc6b3b4454960eb ]

Compresse file and normal file has differ in i_addr addressing,
specifically addrs per inode/block. So, we will face data loss, if we
disable the compression flag on non-empty files. Therefore we should
disallow not only enabling but disabling the compression flag on
non-empty files.

Fixes: 4c8ff7095bef ("f2fs: support data compression")
Signed-off-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Hyeong-Jun Kim <hj514.kim@samsung.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
fs/f2fs/f2fs.h