mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Oleg Drokin <green@linuxhacker.ru>
Cc: linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk
Subject: Re: d_instantiate_unique / NFS inode leakage?
Date: Thu, 05 Jan 2006 02:26:47 +0100	[thread overview]
Message-ID: <1136424407.7847.37.camel@lade.trondhjem.org> (raw)
In-Reply-To: <20060105010047.GJ5743@linuxhacker.ru>

On Thu, 2006-01-05 at 03:00 +0200, Oleg Drokin wrote:
> Hello!
> 
>    Searching for inode leakage in NFS code (seen in 2.6.14 and 2.6.15 at least,
>    have not tried earlier versions), I see suspicious place in
>    d_instantiate_unique (the only user happens to be NFS).
>    There 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.
>    This simple patch below fixes the problem. Unfortunatelly the leakage seems
>    to be non-100% in my testing, so I will continue the testing to see
>    if I still see inodes to leak or not (no leak seen so far with the patch).
> 
> --- fs/dcache.c.orig	2006-01-05 02:28:57.000000000 +0200
> +++ fs/dcache.c	2006-01-05 02:32:08.000000000 +0200
> @@ -838,6 +838,7 @@ struct dentry *d_instantiate_unique(stru
>  		dget_locked(alias);
>  		spin_unlock(&dcache_lock);
>  		BUG_ON(!d_unhashed(alias));
> +		iput(inode);
>  		return alias;
>  	}
>  	list_add(&entry->d_alias, &inode->i_dentry);

Yep, that looks like it ought to be the correct behaviour. Could you
please also add a note to this effect in the DocBook header for
d_instantiate_unique?

Cheers,
  Trond


  reply	other threads:[~2006-01-05  1:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-05  1:00 Oleg Drokin
2006-01-05  1:26 ` Trond Myklebust [this message]
2006-01-05  8:09   ` Oleg Drokin
2006-01-06 20:07     ` Trond Myklebust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1136424407.7847.37.camel@lade.trondhjem.org \
    --to=trond.myklebust@fys.uio.no \
    --cc=green@linuxhacker.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®