linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Minlan Wang <wangminlan@huawei.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jeff Layton <jlayton@redhat.com>, <linux-nfs@vger.kernel.org>
Subject: Re: 3.12-rc2 nfsd oops in nfsd_cache_lookup
Date: Tue, 3 Dec 2013 11:33:42 +0800	[thread overview]
Message-ID: <20131203033342.GA8877@f18.localdomain> (raw)
In-Reply-To: <20131202172547.GA5211@infradead.org>

On Mon, Dec 02, 2013 at 09:25:47AM -0800, Christoph Hellwig wrote:
> On Mon, Dec 02, 2013 at 12:22:19PM -0500, Jeff Layton wrote:
> > Looks like a similar oops to the one reported here:
> > 
> >     https://bugzilla.redhat.com/show_bug.cgi?id=1025907
> > 
> > Do you have a way to reproduce this reliably?
> 
> Seem to happen about 2/3s of the time when running xfstests on a v3
> export for me.  The other one third create a different lockup in the
> same test that I'm looking at at the moment.
> 
I reviewed the code of nfsd_cache_lookup(), this part makes me
suspicious:
in nfsd_cache_lookup():
The first entry in lru_head is keeped for recycle later:
	if (!list_empty(&lru_head)) {
		rp = list_first_entry(&lru_head, struct svc_cacherep, c_lru);
		if (nfsd_cache_entry_expired(rp) ||
		    num_drc_entries >= max_drc_entries) {
			lru_put_end(rp);
			prune_cache_entries();
			goto search_cache;
		}
	}
But in prune_cache_entries(), there's no guarantee that it won't be freed: if
all entries in lru_head is expired, all of them will be freed.
So, later in the search_cache part, if rp from the first entry in lru_head is reused, would we
run into some illegal memory acess, or the problem happened in this
thread?

  reply	other threads:[~2013-12-03  3:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-01 10:29 3.12-rc2 nfsd oops in nfsd_cache_lookup Christoph Hellwig
2013-12-02 17:22 ` Jeff Layton
2013-12-02 17:25   ` Christoph Hellwig
2013-12-03  3:33     ` Minlan Wang [this message]
2013-12-03 10:59       ` Jeff Layton
2013-12-04  0:55         ` Minlan Wang

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=20131203033342.GA8877@f18.localdomain \
    --to=wangminlan@huawei.com \
    --cc=hch@infradead.org \
    --cc=jlayton@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).