From: Tyler Hicks Date: Tue, 11 Jan 2011 18:43:42 +0000 (-0600) Subject: eCryptfs: Copy up lower inode attrs in getattr X-Git-Tag: v2.6.33.8~123 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3cb905a9fcaf1f33feb3593e2b00df3b03405f4e;p=karo-tx-linux.git eCryptfs: Copy up lower inode attrs in getattr commit 55f9cf6bbaa682958a7dd2755f883b768270c3ce upstream. The lower filesystem may do some type of inode revalidation during a getattr call. eCryptfs should take advantage of that by copying the lower inode attributes to the eCryptfs inode after a call to vfs_getattr() on the lower inode. I originally wrote this fix while working on eCryptfs on nfsv3 support, but discovered it also fixed an eCryptfs on ext4 nanosecond timestamp bug that was reported. https://bugs.launchpad.net/bugs/613873 Signed-off-by: Tyler Hicks Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index adbfb3daa0db..e921aa129941 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c @@ -1031,6 +1031,8 @@ int ecryptfs_getattr(struct vfsmount *mnt, struct dentry *dentry, rc = vfs_getattr(ecryptfs_dentry_to_lower_mnt(dentry), ecryptfs_dentry_to_lower(dentry), &lower_stat); if (!rc) { + fsstack_copy_attr_all(dentry->d_inode, + ecryptfs_inode_to_lower(dentry->d_inode)); generic_fillattr(dentry->d_inode, stat); stat->blocks = lower_stat.blocks; }