From: Amir Goldstein Date: Sat, 8 Apr 2017 11:49:06 +0000 (+0300) Subject: vfs: ftruncate check IS_APPEND() on real upper inode X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=78757af6518a35bdc22b4e7f660ff9dbbeba35d7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Miklos Szeredi --- 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);