Skip to content

Commit

Permalink
ovl: copy new uid/gid into overlayfs runtime inode
Browse files Browse the repository at this point in the history
Overlayfs must update uid/gid after chown, otherwise functions
like inode_owner_or_capable() will check user against stale uid.
Catched by xfstests generic/087, it chowns file and calls utimes.

Signed-off-by: Konstantin Khlebnikov <[email protected]>
Signed-off-by: Miklos Szeredi <[email protected]>
Cc: <[email protected]>
  • Loading branch information
koct9i authored and szmi committed Mar 3, 2016
1 parent 45d1173 commit b81de06
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/overlayfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ int ovl_setattr(struct dentry *dentry, struct iattr *attr)

inode_lock(upperdentry->d_inode);
err = notify_change(upperdentry, attr, NULL);
if (!err)
ovl_copyattr(upperdentry->d_inode, dentry->d_inode);
inode_unlock(upperdentry->d_inode);
}
ovl_drop_write(dentry);
Expand Down

0 comments on commit b81de06

Please sign in to comment.