f2fs: prevent atomic write on pinned file

Since atomic write way was changed to out-place-update, we should
prevent it on pinned files.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Daeho Jeong 2024-03-11 16:59:19 -07:00 committed by Jaegeuk Kim
parent 245930617c
commit c644af1332

View File

@ -2083,7 +2083,8 @@ static int f2fs_ioc_start_atomic_write(struct file *filp, bool truncate)
inode_lock(inode);
if (!f2fs_disable_compressed_file(inode)) {
if (!f2fs_disable_compressed_file(inode) ||
f2fs_is_pinned_file(inode)) {
ret = -EINVAL;
goto out;
}