From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@lst.de>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>,
Chandan Rajendra <chandan@linux.ibm.com>,
linux-xfs@vger.kernel.org
Subject: Re: BUG: iomap_dio_rw() accesses freed memory
Date: Wed, 16 Jan 2019 10:18:51 +1100 [thread overview]
Message-ID: <20190115231851.GN4205@dastard> (raw)
In-Reply-To: <20190115210903.GA15737@lst.de>
On Tue, Jan 15, 2019 at 10:09:03PM +0100, Christoph Hellwig wrote:
> On Wed, Jan 16, 2019 at 07:51:41AM +1100, Dave Chinner wrote:
> > Atomic operations don't imply a memory barrier for dependent data,
> > right?
>
> Documentation/atomic_t.txt says:
>
> -------------------------- snip --------------------------
> The rule of thumb:
>
> - non-RMW operations are unordered;
>
> - RMW operations that have no return value are unordered;
>
> - RMW operations that have a return value are fully ordered;
>
> [...]
>
> Fully ordered primitives are ordered against everything prior and everything
> subsequent. Therefore a fully ordered primitive is like having an smp_mb()
> before and an smp_mb() after the primitive.
I guess I haven't looked at the documentation for a while. Or the
implementation for that matter.
/me goes off and looks.
Oh, they are now implemented with built in, explicit
smp_mb__before_atomic() and smp_mb__after_atomic() barriers. Ok,
so the necessary barriers are there, my brain was telling me they
still needed to be added manually and needed updating.....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2019-01-15 23:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-10 10:17 BUG: iomap_dio_rw() accesses freed memory Chandan Rajendra
2019-01-10 14:25 ` Christoph Hellwig
2019-01-10 16:49 ` Chandan Rajendra
2019-01-10 17:09 ` Darrick J. Wong
2019-01-15 18:27 ` Christoph Hellwig
2019-01-15 20:51 ` Dave Chinner
2019-01-15 21:09 ` Christoph Hellwig
2019-01-15 23:18 ` Dave Chinner [this message]
2019-01-15 23:24 ` Darrick J. Wong
2019-01-16 5:59 ` Chandan Rajendra
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=20190115231851.GN4205@dastard \
--to=david@fromorbit.com \
--cc=chandan@linux.ibm.com \
--cc=darrick.wong@oracle.com \
--cc=hch@lst.de \
--cc=linux-xfs@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).