Commit 8ff0971f authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

f2fs: don't allow volatile writes for non-regular file

Now f2fs only supports volatile writes for journal db regular file.
Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent e811898c
...@@ -1598,6 +1598,9 @@ static int f2fs_ioc_start_volatile_write(struct file *filp) ...@@ -1598,6 +1598,9 @@ static int f2fs_ioc_start_volatile_write(struct file *filp)
if (!inode_owner_or_capable(inode)) if (!inode_owner_or_capable(inode))
return -EACCES; return -EACCES;
if (!S_ISREG(inode->i_mode))
return -EINVAL;
ret = mnt_want_write_file(filp); ret = mnt_want_write_file(filp);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment