Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb44d876 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim
Browse files

f2fs: disallow direct IO in atomic write



Atomic write needs page cache to cache data of transaction,
direct IO should never be allowed in atomic write, detect
and deny it when open atomic write file.

Signed-off-by: default avatarGao Xiang <gaoxiang25@huawei.com>
Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent c3d777c7
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1836,6 +1836,9 @@ static int f2fs_ioc_start_atomic_write(struct file *filp)
	if (!S_ISREG(inode->i_mode))
		return -EINVAL;

	if (filp->f_flags & O_DIRECT)
		return -EINVAL;

	ret = mnt_want_write_file(filp);
	if (ret)
		return ret;