From fe464611126db63b21aca66a5c9ee0416b1c6d38 Mon Sep 17 00:00:00 2001 From: Erez Zadok Date: Wed, 5 Jun 2013 01:36:58 -0400 Subject: [PATCH] Wrapfs: copy lower inode attributes in ->ioctl Some ioctls (e.g., EXT2_IOC_SETFLAGS) can change inode attributes, so copy them from lower inode. Signed-off-by: Erez Zadok --- fs/wrapfs/file.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/wrapfs/file.c b/fs/wrapfs/file.c index 1611b222df2e..982581635442 100644 --- a/fs/wrapfs/file.c +++ b/fs/wrapfs/file.c @@ -77,6 +77,10 @@ static long wrapfs_unlocked_ioctl(struct file *file, unsigned int cmd, if (lower_file->f_op->unlocked_ioctl) err = lower_file->f_op->unlocked_ioctl(lower_file, cmd, arg); + /* some ioctls can change inode attributes (EXT2_IOC_SETFLAGS) */ + if (!err) + fsstack_copy_attr_all(file->f_path.dentry->d_inode, + lower_file->f_path.dentry->d_inode); out: return err; } -- 2.43.0