Skip to content

Commit

Permalink
eCryptfs: Copy up lower inode attrs after setting lower xattr
Browse files Browse the repository at this point in the history
After passing through a ->setxattr() call, eCryptfs needs to copy the
inode attributes from the lower inode to the eCryptfs inode, as they
may have changed in the lower filesystem's ->setxattr() path.

One example is if an extended attribute containing a POSIX Access
Control List is being set. The new ACL may cause the lower filesystem to
modify the mode of the lower inode and the eCryptfs inode would need to
be updated to reflect the new mode.

https://launchpad.net/bugs/926292

Signed-off-by: Tyler Hicks <[email protected]>
Reported-by: Sebastien Bacher <[email protected]>
Cc: John Johansen <[email protected]>
Cc: <[email protected]>
  • Loading branch information
tyhicks committed Feb 16, 2012
1 parent 4a26620 commit 545d680
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/ecryptfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,8 @@ ecryptfs_setxattr(struct dentry *dentry, const char *name, const void *value,
}

rc = vfs_setxattr(lower_dentry, name, value, size, flags);
if (!rc)
fsstack_copy_attr_all(dentry->d_inode, lower_dentry->d_inode);
out:
return rc;
}
Expand Down

0 comments on commit 545d680

Please sign in to comment.