[lkml]   [2006]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 03/23] [PATCH] d_instantiate_unique / NFS inode leakage
-stable review patch.  If anyone has any objections, please let us know.

If we have found aliased dentry that we return, inode reference is not
dropped and inode is not attached anywhere, so it seems the reference to
inode is leaked in that case.

Cc: Trond Myklebust <>,
Cc: <>
Cc: Christoph Hellwig <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
Signed-off-by: Chris Wright <>

fs/dcache.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletion(-)

Index: linux-
--- linux-
+++ linux-
@@ -808,10 +808,14 @@ void d_instantiate(struct dentry *entry,
* Fill in inode information in the entry. On success, it returns NULL.
* If an unhashed alias of "entry" already exists, then we return the
- * aliased dentry instead.
+ * aliased dentry instead and drop one reference to inode.
* Note that in order to avoid conflicts with rename() etc, the caller
* had better be holding the parent directory semaphore.
+ *
+ * This also assumes that the inode count has been incremented
+ * (or otherwise set) by the caller to indicate that it is now
+ * in use by the dcache.
struct dentry *d_instantiate_unique(struct dentry *entry, struct inode *inode)
@@ -838,6 +842,7 @@ struct dentry *d_instantiate_unique(stru
+ iput(inode);
return alias;
list_add(&entry->d_alias, &inode->i_dentry);
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2006-02-08 07:49    [W:0.083 / U:0.872 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site