diff options
author | Chao Yu <yuchao0@huawei.com> | 2017-03-17 08:43:57 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-03-22 03:34:18 +0100 |
commit | 8ff0971f1500953935339c23c91f660793fd4c64 (patch) | |
tree | fc4dd10c962c65488f03a6cf690564d433b3f500 | |
parent | f2fs: don't allow atomic writes for not regular files (diff) | |
download | linux-8ff0971f1500953935339c23c91f660793fd4c64.tar.xz linux-8ff0971f1500953935339c23c91f660793fd4c64.zip |
f2fs: don't allow volatile writes for non-regular file
Now f2fs only supports volatile writes for journal db regular file.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r-- | fs/f2fs/file.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 2cf16ed5b74c..427ab1b41de3 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1598,6 +1598,9 @@ static int f2fs_ioc_start_volatile_write(struct file *filp) if (!inode_owner_or_capable(inode)) return -EACCES; + if (!S_ISREG(inode->i_mode)) + return -EINVAL; + ret = mnt_want_write_file(filp); if (ret) return ret; |