Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 78757af6 authored by Amir Goldstein's avatar Amir Goldstein Committed by Miklos Szeredi
Browse files

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: default avatarAmir Goldstein <amir73il@gmail.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent 33006cdf
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);