/[linux-patches]/genpatches-2.6/tags/2.6.15-11/1033_4_nfs-inode-leakage.patch
Gentoo

Contents of /genpatches-2.6/tags/2.6.15-11/1033_4_nfs-inode-leakage.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 351 - (show annotations) (download)
Wed Mar 29 11:55:38 2006 UTC (12 years, 8 months ago) by dsd
File size: 1968 byte(s)
2.6.15-11 release
1 From stable-bounces@linux.kernel.org Tue Jan 31 16:38:43 2006
2 Date: Tue, 10 Jan 2006 09:28:45 -0800
3 From: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
4 To: git-commits-head@vger.kernel.org
5 Cc:
6 Subject: [PATCH] d_instantiate_unique / NFS inode leakage
7
8 From: Oleg Drokin <green@linuxhacker.ru>
9
10 If we have found aliased dentry that we return, inode reference is not
11 dropped and inode is not attached anywhere, so it seems the reference to
12 inode is leaked in that case.
13
14 Cc: Trond Myklebust <trond.myklebust@fys.uio.no>,
15 Cc: <viro@parcelfarce.linux.theplanet.co.uk>
16 Cc: Christoph Hellwig <hch@lst.de>
17 Signed-off-by: Andrew Morton <akpm@osdl.org>
18 Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 Signed-off-by: Chris Wright <chrisw@sous-sol.org>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
21 ---
22
23 fs/dcache.c | 7 ++++++-
24 1 files changed, 6 insertions(+), 1 deletion(-)
25
26 Index: linux-2.6.15.3/fs/dcache.c
27 ===================================================================
28 --- linux-2.6.15.3.orig/fs/dcache.c
29 +++ linux-2.6.15.3/fs/dcache.c
30 @@ -808,10 +808,14 @@ void d_instantiate(struct dentry *entry,
31 *
32 * Fill in inode information in the entry. On success, it returns NULL.
33 * If an unhashed alias of "entry" already exists, then we return the
34 - * aliased dentry instead.
35 + * aliased dentry instead and drop one reference to inode.
36 *
37 * Note that in order to avoid conflicts with rename() etc, the caller
38 * had better be holding the parent directory semaphore.
39 + *
40 + * This also assumes that the inode count has been incremented
41 + * (or otherwise set) by the caller to indicate that it is now
42 + * in use by the dcache.
43 */
44 struct dentry *d_instantiate_unique(struct dentry *entry, struct inode *inode)
45 {
46 @@ -838,6 +842,7 @@ struct dentry *d_instantiate_unique(stru
47 dget_locked(alias);
48 spin_unlock(&dcache_lock);
49 BUG_ON(!d_unhashed(alias));
50 + iput(inode);
51 return alias;
52 }
53 list_add(&entry->d_alias, &inode->i_dentry);

  ViewVC Help
Powered by ViewVC 1.1.20