X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=fs%2Fecryptfs%2Fdentry.c;h=cb20b964419f8061bdf7391707a92ab0825c0716;hb=17a61cdfc54d4d2f01a7285051ce86a0afdd3606;hp=f0d2a433242b58757f33483fec2a301410ce2aab;hpb=c45aa055c32b488fc3fd73c760df372b09acf69a;p=powerpc.git diff --git a/fs/ecryptfs/dentry.c b/fs/ecryptfs/dentry.c index f0d2a43324..cb20b96441 100644 --- a/fs/ecryptfs/dentry.c +++ b/fs/ecryptfs/dentry.c @@ -24,6 +24,8 @@ #include #include +#include +#include #include "ecryptfs_kernel.h" /** @@ -56,6 +58,12 @@ static int ecryptfs_d_revalidate(struct dentry *dentry, struct nameidata *nd) rc = lower_dentry->d_op->d_revalidate(lower_dentry, nd); nd->dentry = dentry_save; nd->mnt = vfsmount_save; + if (dentry->d_inode) { + struct inode *lower_inode = + ecryptfs_inode_to_lower(dentry->d_inode); + + fsstack_copy_attr_all(dentry->d_inode, lower_inode, NULL); + } out: return rc; } @@ -70,14 +78,14 @@ struct kmem_cache *ecryptfs_dentry_info_cache; */ static void ecryptfs_d_release(struct dentry *dentry) { - struct dentry *lower_dentry; - - lower_dentry = ecryptfs_dentry_to_lower(dentry); - if (ecryptfs_dentry_to_private(dentry)) + if (ecryptfs_dentry_to_private(dentry)) { + if (ecryptfs_dentry_to_lower(dentry)) { + mntput(ecryptfs_dentry_to_lower_mnt(dentry)); + dput(ecryptfs_dentry_to_lower(dentry)); + } kmem_cache_free(ecryptfs_dentry_info_cache, ecryptfs_dentry_to_private(dentry)); - if (lower_dentry) - dput(lower_dentry); + } return; }