Skip to content
Commit c25a8977 authored by NeilBrown's avatar NeilBrown Committed by Anna Schumaker
Browse files

nfs_localio: change nfsd_file_put_local() to take a pointer to __rcu pointer



Instead of calling xchg() and unrcu_pointer() before
nfsd_file_put_local(), we now pass pointer to the __rcu pointer and call
xchg() and unrcu_pointer() inside that function.

Where unrcu_pointer() is currently called the internals of "struct
nfsd_file" are not known and that causes older compilers such as gcc-8
to complain.

In some cases we have a __kernel (aka normal) pointer not an __rcu
pointer so we need to cast it to __rcu first.  This is strictly a
weakening so no information is lost.  Somewhat surprisingly, this cast
is accepted by gcc-8.

This has the pleasing result that the cmpxchg() which sets ro_file and
rw_file, and also the xchg() which clears them, are both now in the nfsd
code.

Reported-by: default avatarPali Rohár <pali@kernel.org>
Reported-by: default avatarVincent Mailhol <mailhol.vincent@wanadoo.fr>
Fixes: 86e00412 ("nfs: cache all open LOCALIO nfsd_file(s) in client")
Signed-off-by: default avatarNeilBrown <neil@brown.name>
Signed-off-by: default avatarAnna Schumaker <anna.schumaker@oracle.com>
parent 21fb4403
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment