linux/fs/nfs_common
NeilBrown c25a89770d 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: Pali Rohár <pali@kernel.org>
Reported-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Fixes: 86e0041225 ("nfs: cache all open LOCALIO nfsd_file(s) in client")
Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
2025-05-28 17:17:14 -04:00
..
common.c nfs: fix incorrect error handling in LOCALIO 2025-01-21 11:34:43 -05:00
grace.c fs: nfs: add missing MODULE_DESCRIPTION() macros 2024-07-08 13:47:24 -04:00
localio_trace.c nfs_common: add nfs_localio trace events 2025-01-14 17:05:10 -05:00
localio_trace.h nfs_common: add nfs_localio trace events 2025-01-14 17:05:10 -05:00
Makefile nfs_common: add nfs_localio trace events 2025-01-14 17:05:10 -05:00
nfs_ssc.c NFSv4.2: remove MODULE_LICENSE in non-modules 2023-04-13 13:13:52 -07:00
nfsacl.c fs: nfs: acl: Avoid -Wflex-array-member-not-at-end warning 2025-03-10 09:11:04 -04:00
nfslocalio.c nfs_localio: change nfsd_file_put_local() to take a pointer to __rcu pointer 2025-05-28 17:17:14 -04:00