]> asedeno.scripts.mit.edu Git - linux.git/commit
fs/dcache: Use release-acquire for name/length update
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 9 Oct 2017 17:04:27 +0000 (10:04 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 4 Dec 2017 18:52:52 +0000 (10:52 -0800)
commit7088efa9137a15d7d21e3abce73e40c9c8a18d68
treea410e9354ca53593b66a1ca8e34041b7d480aaaa
parentcb7e125e03274cffa97d74433c876765efffaf6a
fs/dcache: Use release-acquire for name/length update

The code in __d_alloc() carefully orders filling in the NUL character
of the name (and the length, hash, and the name itself) with assigning
of the name itself.  However, prepend_name() does not order the accesses
to the ->name and ->len fields, other than on TSO systems.  This commit
therefore replaces prepend_name()'s READ_ONCE() of ->name with an
smp_load_acquire(), which orders against the subsequent READ_ONCE() of
->len.  Because READ_ONCE() now incorporates smp_read_barrier_depends(),
prepend_name()'s smp_read_barrier_depends() is removed.  Finally,
to save a line, the smp_wmb()/store pair in __d_alloc() is replaced
by smp_store_release().

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: <linux-fsdevel@vger.kernel.org>
fs/dcache.c