summaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2017-04-08 13:49:06 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2017-04-20 16:37:26 +0200
commit78757af6518a35bdc22b4e7f660ff9dbbeba35d7 (patch)
tree00f718f972f02f174190c99174ac21a8ce2ebdbc /fs/open.c
parentovl: Use designated initializers (diff)
downloadlinux-78757af6518a35bdc22b4e7f660ff9dbbeba35d7.tar.xz
linux-78757af6518a35bdc22b4e7f660ff9dbbeba35d7.zip
vfs: ftruncate check IS_APPEND() on real upper inode
ftruncate an overlayfs inode was checking IS_APPEND() on overlay inode, but overlay inode does not have the S_APPEND flag. Check IS_APPEND() on real upper inode instead. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/open.c b/fs/open.c
index 949cef29c3bb..993a91d20cc7 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -193,7 +193,8 @@ static long do_sys_ftruncate(unsigned int fd, loff_t length, int small)
goto out_putf;
error = -EPERM;
- if (IS_APPEND(inode))
+ /* Check IS_APPEND on real upper inode */
+ if (IS_APPEND(file_inode(f.file)))
goto out_putf;
sb_start_write(inode->i_sb);