f2fs: fix to check compress file in f2fs_move_file_range()

[ Upstream commit fb9b65340c818875ea86464faf3c744bdce0055c ]

f2fs_move_file_range() doesn't support migrating compressed cluster
data, let's add the missing check condition and return -EOPNOTSUPP
for the case until we support it.

Fixes: 4c8ff7095b ("f2fs: support data compression")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Chao Yu 2023-12-10 19:35:44 +08:00 committed by Greg Kroah-Hartman
parent 9bfd5ea715
commit 8835766027
1 changed files with 5 additions and 0 deletions

View File

@ -2821,6 +2821,11 @@ static int f2fs_move_file_range(struct file *file_in, loff_t pos_in,
goto out; goto out;
} }
if (f2fs_compressed_file(src) || f2fs_compressed_file(dst)) {
ret = -EOPNOTSUPP;
goto out_unlock;
}
ret = -EINVAL; ret = -EINVAL;
if (pos_in + len > src->i_size || pos_in + len < pos_in) if (pos_in + len > src->i_size || pos_in + len < pos_in)
goto out_unlock; goto out_unlock;