[PATCH] eCryptfs: Fix handling of lower d_count

Fix the use of dget/dput calls to balance out on the lower filesystem.

Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Michael Halcrow
2006-10-30 22:07:20 -08:00
committed by Linus Torvalds
parent 316bb95e8e
commit 45ec4ababe
2 changed files with 27 additions and 43 deletions

View 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;
}