From: "J. Bruce Fields" <bfields@fieldses.org>
To: Bodo Stroesser <bstroesser@ts.fujitsu.com>
Cc: neilb@suse.de, linux-nfs@vger.kernel.org
Subject: Re: sunrpc/cache.c: races while updating cache entries
Date: Wed, 3 Apr 2013 14:36:12 -0400 [thread overview]
Message-ID: <20130403183612.GD6044@fieldses.org> (raw)
In-Reply-To: <61eb00$3hon1j@dgate20u.abg.fsc.net>
On Thu, Mar 21, 2013 at 05:41:35PM +0100, Bodo Stroesser wrote:
> On 21 Mar 2013 00:34:00 +0100 NeilBrown <neilb@suse.de> wrote:
> > This applies only to SLES11-SP1 (2.6.32+) right?
> > In mainline the request won't be dropped because the cache item isn't assumed
> > to still be valid.
>
> I agree, there will be no drop in mainline.
>
> But in mainline there will be a useless upcall. That upcall might even be
> processed by the reader, if cache_clean isn't faster then the reader.
> The answer from the reader will again replace the current cache entry
> (which is just a few microseconds old) by a new one. The new one must be
> allocated, the replaced one must later be cleaned. The single item cache
> is invalidated again.
>
> In worst case, the unnecessary replacement also could trigger the next
> round of the game ...
>
> So in my opinion it would be better to add the patch you suggested below
> to mainline also.
>
> >
> > So we need to make sure that sunrpc_cache_pipe_upcall doesn't make an upcall
> > on a cache item that has been replaced. I'd rather not use the CACHE_CLEAN
> > bit (whether renamed or not) as it has a well defined meaning "has been
> > removed from cache" and I'd rather not blur that meaning.
> > We already have a state that means "this has been replace"- ->expiry_time is
> > 0.
> > So how about adding
> > if (h->expiry_time == 0)
> > return -EAGAIN;
> > to sunrpc_cache_pipe_upcall() in SLES11-SP1.
> >
> > Does that work for you?
>
> Yes, that looks good. My test with this fix is running successfully
> since 5 hours. I'll let it run until Monday.
Apologies, I've completely lost track of this thread: do we know what
mainline needs now?
--b.
next parent reply other threads:[~2013-04-03 18:36 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <61eb00$3hon1j@dgate20u.abg.fsc.net>
2013-04-03 18:36 ` J. Bruce Fields [this message]
[not found] <61eb00$3oamkh@dgate20u.abg.fsc.net>
2013-06-13 1:54 ` sunrpc/cache.c: races while updating cache entries NeilBrown
2013-06-13 2:04 ` J. Bruce Fields
2013-06-03 14:27 Bodo Stroesser
-- strict thread matches above, loose matches on Subject: below --
2013-04-19 16:55 Bodo Stroesser
2013-05-10 7:51 ` Namjae Jeon
2013-05-13 4:08 ` Namjae Jeon
[not found] <d6437a$47jkcm@dgate10u.abg.fsc.net>
2013-04-05 21:08 ` J. Bruce Fields
2013-04-05 15:33 Bodo Stroesser
[not found] <61eb00$3itd78@dgate20u.abg.fsc.net>
2013-04-05 12:40 ` J. Bruce Fields
2013-04-04 17:59 Bodo Stroesser
2013-03-21 16:41 Bodo Stroesser
[not found] <61eb00$3hl8ah@dgate20u.abg.fsc.net>
2013-03-20 23:33 ` NeilBrown
2013-03-20 18:45 Bodo Stroesser
[not found] <d6437a$45t6bs@dgate10u.abg.fsc.net>
2013-03-20 4:39 ` NeilBrown
2013-03-19 19:58 Bodo Stroesser
[not found] <d6437a$45efvo@dgate10u.abg.fsc.net>
2013-03-19 3:23 ` NeilBrown
2013-03-15 20:35 Bodo Stroesser
2013-03-14 17:31 Bodo Stroesser
2013-03-13 16:47 Bodo Stroesser
[not found] <61eb00$3gpm51@dgate20u.abg.fsc.net>
2013-03-13 5:55 ` NeilBrown
2013-03-11 16:13 Bodo Stroesser
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=20130403183612.GD6044@fieldses.org \
--to=bfields@fieldses.org \
--cc=bstroesser@ts.fujitsu.com \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
/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).