Wrapfs: copy lower inode attributes in ->ioctl
authorErez Zadok <ezk@cs.sunysb.edu>
Wed, 5 Jun 2013 05:36:58 +0000 (01:36 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 27 Dec 2016 03:53:09 +0000 (22:53 -0500)
Some ioctls (e.g., EXT2_IOC_SETFLAGS) can change inode attributes, so copy
them from lower inode.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/wrapfs/file.c

index 1611b222df2e8d62b1ee8bcde93ed2e0fc7c8b3c..982581635442d4c3cd78aa8b5e67a26af8dfcbcb 100644 (file)
@@ -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;
 }