Wrapfs: copy lower inode attributes in ->ioctl
authorErez Zadok <ezk@cs.sunysb.edu>
Wed, 5 Jun 2013 05:44:12 +0000 (01:44 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Wed, 5 Jun 2013 05:44:12 +0000 (01:44 -0400)
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 b73e1f8bc12b965b4bfbabb39c7af09f08109249..1567a5c7bbd82401435cd921ed791b0ecffb26ac 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;
 }