All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Andrea Parri <andrea.parri@amarulasolutions.com>
Cc: dhowells@redhat.com, gregkh@linux-foundation.org,
	Kiran Kumar Modukuri <kiran.modukuri@gmail.com>,
	viro@zeniv.linux.org.uk, sandeen@redhat.com,
	linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] fscache: Fix race in fscache_op_complete() due to split atomic_sub & read
Date: Wed, 28 Nov 2018 14:43:24 +0000	[thread overview]
Message-ID: <4283.1543416204@warthog.procyon.org.uk> (raw)
In-Reply-To: <20181126165606.GA11282@andrea>

Andrea Parri <andrea.parri@amarulasolutions.com> wrote:

> > > > > > Fix this by using atomic_sub_return() instead of two calls.
> > > > > 
> > > > > Seems a case for atomic_sub_return_relaxed()... why not?
> > > > 
> > > > Ummm...  In that case, should it be atomic_sub_return_release()?
> > > 
> > > Hard to tell for me: your diff./changelog is all I know about fs-cache
> > > ... (and this suggests -no-, given that atomic_sub() and atomic_read()
> > > provide no ordering...); good question though. ;-)
> > 
> > Yeah, that doesn't mean that it shouldn't be stricter than 'relaxed'.
> > It's kind of like an unlock/release operation, so I think 'release' is
> > probably the minimum requirement.
> 
> Sure.  My point was: those operations are currently not atomic _and_
> they provide no ordering; I think that the above commit message does
> a good work in explaining *why* we need atomicity, but can't say the
> same for the memory-ordering requirement.

Having discussed it with Paul McKenney and thought about it some more, I think
relaxed is probably okay since there isn't a pair of variables that need
ordering.

David

  parent reply	other threads:[~2018-11-28 14:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-17 14:23 [PATCH 0/4] FS-Cache: Miscellaneous fixes David Howells
2018-10-17 14:23 ` [PATCH 1/4] cachefiles: fix the race between cachefiles_bury_object() and rmdir(2) David Howells
2018-10-17 14:23 ` [PATCH 2/4] fscache: Fix race in fscache_op_complete() due to split atomic_sub & read David Howells
2018-10-17 15:11   ` Andrea Parri
2018-10-17 15:32   ` David Howells
2018-10-17 16:48     ` Andrea Parri
2018-11-26 16:26     ` David Howells
2018-11-26 16:56       ` Andrea Parri
2018-11-28 14:43       ` David Howells [this message]
2018-11-28 20:45         ` Andrea Parri
2018-10-17 14:23 ` [PATCH 3/4] fscache: Fix incomplete initialisation of inline key space David Howells
2018-10-17 14:23 ` [PATCH 4/4] fscache: Fix out of bound read in long cookie keys David Howells
2018-10-18 10:03 ` [PATCH 0/4] FS-Cache: Miscellaneous fixes Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2018-10-17 14:16 David Howells
2018-10-17 14:17 ` [PATCH 2/4] fscache: Fix race in fscache_op_complete() due to split atomic_sub & read David Howells

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=4283.1543416204@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=andrea.parri@amarulasolutions.com \
    --cc=gregkh@linux-foundation.org \
    --cc=kiran.modukuri@gmail.com \
    --cc=linux-cachefs@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.