Wrapfs: copy lower inode attributes in ->ioctl
authorErez Zadok <ezk@cs.sunysb.edu>
Wed, 5 Jun 2013 05:44:26 +0000 (01:44 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Sun, 17 Nov 2013 21:08:46 +0000 (16:08 -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 b4878d8d85d924ed5a76c2f2be08e590e182cb2f..28c72e7a803630e08ae3cceeda915e5a4b6f7e3a 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;
 }