]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/ecryptfs/dentry.c
[PATCH] eCryptfs: Fix handling of lower d_count
[karo-tx-linux.git] / fs / ecryptfs / dentry.c
index f0d2a433242b58757f33483fec2a301410ce2aab..0b9992ab990f4cab4983a89aa4eb4f4026a1820b 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <linux/dcache.h>
 #include <linux/namei.h>
+#include <linux/mount.h>
 #include "ecryptfs_kernel.h"
 
 /**
@@ -76,8 +77,13 @@ static void ecryptfs_d_release(struct dentry *dentry)
        if (ecryptfs_dentry_to_private(dentry))
                kmem_cache_free(ecryptfs_dentry_info_cache,
                                ecryptfs_dentry_to_private(dentry));
-       if (lower_dentry)
+       if (lower_dentry) {
+               struct vfsmount *lower_mnt =
+                       ecryptfs_dentry_to_lower_mnt(dentry);
+
+               mntput(lower_mnt);
                dput(lower_dentry);
+       }
        return;
 }