From d8754c9f7085b133f8be6fda2e5e82fe3930c42a Mon Sep 17 00:00:00 2001 From: Erez Zadok Date: Wed, 5 Jun 2013 01:34:01 -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 d0d2bac843f7..adfec135cb0e 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