diff options
author | Amir Goldstein <amir73il@gmail.com> | 2017-04-08 07:49:06 -0400 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2017-04-20 10:37:26 -0400 |
commit | 78757af6518a35bdc22b4e7f660ff9dbbeba35d7 (patch) | |
tree | 00f718f972f02f174190c99174ac21a8ce2ebdbc /fs/open.c | |
parent | 33006cdf9c038dca9b3d4c148a509de851a66ea9 (diff) |
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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -193,7 +193,8 @@ static long do_sys_ftruncate(unsigned int fd, loff_t length, int small) | |||
193 | goto out_putf; | 193 | goto out_putf; |
194 | 194 | ||
195 | error = -EPERM; | 195 | error = -EPERM; |
196 | if (IS_APPEND(inode)) | 196 | /* Check IS_APPEND on real upper inode */ |
197 | if (IS_APPEND(file_inode(f.file))) | ||
197 | goto out_putf; | 198 | goto out_putf; |
198 | 199 | ||
199 | sb_start_write(inode->i_sb); | 200 | sb_start_write(inode->i_sb); |