freebsd-dev/sys/fs/nfsclient
Rick Macklem ead50c94cb nfscl: Fix must_commit/writeverf handling for Direct I/O
Without this patch, the KASSERT(must_commit == 0,..) can be
triggered by the writeverf in the Direct I/O write reply changing.
This is not a situation that should cause a panic(). Correct
handling is to ignore the change in "writeverf" for Direct
I/O, since it is done with NFSWRITE_FILESYNC.

This patch modifies the semantics of the "must_commit"
argument slightly, allowing an initial value of 2 to indicate
that a change in "writeverf" should be ignored.
It also fixes the KASSERT()s.

This bug would affect few, since Direct I/O is not enabled
by default and "writeverf" rarely changes. Normally "writeverf"
only changes when a NFS server reboots, however I found the
bug when testing against a Linux 5.15.1 kernel nfsd, which
replied to a NFSWRITE_FILESYNC write with a "writeverf" of all
0x0 bytes.

MFC after:	2 weeks
2021-12-11 15:00:30 -08:00
..
nfs_clbio.c nfscl: Fix must_commit/writeverf handling for Direct I/O 2021-12-11 15:00:30 -08:00
nfs_clcomsubs.c nfsclient: Fix a typo in a comment 2021-09-26 15:17:00 +02:00
nfs_clkdtrace.c fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs_clkrpc.c fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs_clnfsiod.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
nfs_clnode.c nfscl: Cache an open stateid for the "oneopenown" mount option 2021-07-28 15:48:27 -07:00
nfs_clport.c nfssvc: Zero the buffer copied out when NFSSVC_DUMPMNTOPTS is set 2021-07-15 22:41:10 -04:00
nfs_clrpcops.c nfscl: Fix must_commit/writeverf handling for Direct I/O 2021-12-11 15:00:30 -08:00
nfs_clstate.c nfscl: Sanity check the callback tag length 2021-12-09 14:15:48 -08:00
nfs_clsubs.c nfsclient: add nfs node locking around uses of n_direofoffset 2021-02-28 14:53:54 -08:00
nfs_clvfsops.c nfscl: Fix use after free for forced dismount 2021-11-03 12:15:40 -07:00
nfs_clvnops.c nfscl: Disable use of the LookupOpen RPC 2021-11-27 15:34:45 -08:00
nfs_kdtrace.h fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs.h Remove "struct ucred*" argument from vtruncbuf 2019-05-24 20:27:50 +00:00
nfsmount.h nfscl: Add a VOP_DEALLOCATE() for the NFSv4.2 client 2021-08-27 18:31:36 -07:00
nfsnode.h PR#259071 provides a test program that fails for the NFS client. 2021-10-30 16:35:02 -07:00
nlminfo.h sys/fs: further adoption of SPDX licensing ID tags. 2017-11-27 15:15:37 +00:00