opnsense-src/sys/fs/nfsserver
Rick Macklem eb345e05ac nfsd: Fix close handling when vfs.nfsd.enable_locallocks=1
nfsrv_freeopen() was being called after the mutex
lock was released, making it possible for other
kernel threads to change the lists while nfsrv_freeopen()
took the nfsstateid out of the lists.

This patch moves the code around
"if (nfsrv_freeopen(stp, vp, 1 p) == 0) {"
into nfsrv_freeopen(), so that it can remove the nfsstateid
structure from all lists before unlocking the mutex.
This should avoid any race between CLOSE and other nfsd threads
updating the NFSv4 state.

The patch does not affect semantics when vfs.nfsd.enable_locallocks=0.

PR:	280978
Tested by:	Matthew L. Dailey <matthew.l.dailey@dartmouth.edu>
MFC after:	1 week
2024-09-30 15:49:57 -07:00
..
nfs_fha_new.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
nfs_fha_new.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
nfs_nfsdcache.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
nfs_nfsdkrpc.c nfsserver: Default to nfs_reserved_port_only="YES" 2024-04-23 12:54:46 -04:00
nfs_nfsdport.c nfsd: Fix handling of NFSv4 setable attributes 2024-08-27 14:19:33 -07:00
nfs_nfsdserv.c nfsd: Fix handling of NFSv4 setable attributes 2024-08-27 14:19:33 -07:00
nfs_nfsdsocket.c nfsd: Fix nfsrv_cleanclient so that it can be called with a mutex 2024-06-21 15:08:48 -07:00
nfs_nfsdstate.c nfsd: Fix close handling when vfs.nfsd.enable_locallocks=1 2024-09-30 15:49:57 -07:00
nfs_nfsdsubs.c nfsd: Delete an unused VNET global variable 2024-06-08 16:40:52 -07:00