diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-03-17 10:04:15 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-03-21 22:34:17 -0400 |
commit | e811898c97f83aef6c1652fbfbf5294bf542159c (patch) | |
tree | d8d7b467de8a5635bd8ac4155052f7073ad8f28d /fs/f2fs/file.c | |
parent | 8c242db9b8c01b252290e23827163787f07e01d1 (diff) | |
download | linux-e811898c97f83aef6c1652fbfbf5294bf542159c.tar.gz linux-e811898c97f83aef6c1652fbfbf5294bf542159c.tar.bz2 linux-e811898c97f83aef6c1652fbfbf5294bf542159c.zip |
f2fs: don't allow atomic writes for not regular files
The atomic writes only supports regular files for database.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-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 3212dfa1a50e..2cf16ed5b74c 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1518,6 +1518,9 @@ static int f2fs_ioc_start_atomic_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; |