[GIT PULL] NFSD changes for 6.0

From: Chuck Lever III
Date: Tue Aug 09 2022 - 09:56:52 EST


Hi Linus-

Sorry this PR has been delayed. A last minute decision was made to
include a fix that needed to go before a major change that was
already queued up. I wanted to give the full re-worked series a
few days in linux-next.


The following changes since commit ff6992735ade75aae3e35d16b17da1008d753d28:

Linux 5.19-rc7 (2022-07-17 13:30:22 -0700)

are available in the Git repository at:

https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git tags/nfsd-6.0

for you to fetch changes up to 6930bcbfb6ceda63e298c6af6d733ecdf6bd4cde:

lockd: detect and reject lock arguments that overflow (2022-08-04 10:28:48 -0400)

----------------------------------------------------------------
NFSD 6.0 Release Notes

Work on "courteous server", which was introduced in 5.19, continues
apace. This release introduces a more flexible limit on the number
of NFSv4 clients that NFSD allows, now that NFSv4 clients can remain
in courtesy state long after the lease expiration timeout. The
client limit is adjusted based on the physical memory size of the
server.

The NFSD filecache is a cache of files held open by NFSv4 clients or
recently touched by NFSv2 or NFSv3 clients. This cache had some
significant scalability constraints that have been relieved in this
release. Thanks to all who contributed to this work.

A data corruption bug found during the most recent NFS bake-a-thon
that involves NFSv3 and NFSv4 clients writing the same file has been
addressed in this release.

This release includes several improvements in CPU scalability for
NFSv4 operations. In addition, Neil Brown provided patches that
simplify locking during file lookup, creation, rename, and removal
that enables subsequent work on making these operations more
scalable. We expect to see that work materialize in the next
release.

There are also numerous single-patch fixes, clean-ups, and the
usual improvements in observability.

----------------------------------------------------------------
Benjamin Coddington (1):
NLM: Defend against file_lock changes after vfs_test_lock()

Chuck Lever (56):
SUNRPC: Fix xdr_encode_bool()
SUNRPC: Expand the svc_alloc_arg_err tracepoint
NFSD: Instrument fh_verify()
SUNRPC: Fix server-side fault injection documentation
NFSD: Demote a WARN to a pr_warn()
NFSD: Report filecache LRU size
NFSD: Report count of calls to nfsd_file_acquire()
NFSD: Report count of freed filecache items
NFSD: Report average age of filecache items
NFSD: Add nfsd_file_lru_dispose_list() helper
NFSD: Refactor nfsd_file_gc()
NFSD: Refactor nfsd_file_lru_scan()
NFSD: Report the number of items evicted by the LRU walk
NFSD: Record number of flush calls
NFSD: Zero counters when the filecache is re-initialized
NFSD: Hook up the filecache stat file
NFSD: WARN when freeing an item still linked via nf_lru
NFSD: Trace filecache LRU activity
NFSD: Leave open files out of the filecache LRU
NFSD: Fix the filecache LRU shrinker
NFSD: Never call nfsd_file_gc() in foreground paths
NFSD: No longer record nf_hashval in the trace log
NFSD: Remove lockdep assertion from unhash_and_release_locked()
NFSD: nfsd_file_unhash can compute hashval from nf->nf_inode
NFSD: Refactor __nfsd_file_close_inode()
NFSD: nfsd_file_hash_remove can compute hashval
NFSD: Remove nfsd_file::nf_hashval
NFSD: Replace the "init once" mechanism
NFSD: Set up an rhashtable for the filecache
NFSD: Convert the filecache to use rhashtable
NFSD: Clean up unused code after rhashtable conversion
NFSD: Separate tracepoints for acquire and create
NFSD: Move nfsd_file_trace_alloc() tracepoint
NFSD: NFSv4 CLOSE should release an nfsd_file immediately
NFSD: Ensure nf_inode is never dereferenced
NFSD: Optimize nfsd4_encode_operation()
NFSD: Optimize nfsd4_encode_fattr()
NFSD: Clean up SPLICE_OK in nfsd4_encode_read()
NFSD: Add an nfsd4_read::rd_eof field
NFSD: Optimize nfsd4_encode_readv()
NFSD: Simplify starting_len
NFSD: Use xdr_pad_size()
NFSD: Clean up nfsd4_encode_readlink()
NFSD: Fix strncpy() fortify warning
NFSD: nfserrno(-ENOMEM) is nfserr_jukebox
NFSD: Shrink size of struct nfsd4_copy_notify
NFSD: Shrink size of struct nfsd4_copy
NFSD: Reorder the fields in struct nfsd4_op
NFSD: Make nfs4_put_copy() static
NFSD: Replace boolean fields in struct nfsd4_copy
NFSD: Refactor nfsd4_cleanup_inter_ssc() (1/2)
NFSD: Refactor nfsd4_cleanup_inter_ssc() (2/2)
NFSD: Refactor nfsd4_do_copy()
NFSD: Remove kmalloc from nfsd4_do_async_copy()
NFSD: Add nfsd4_send_cb_offload()
NFSD: Move copy offload callback arguments into a separate structure

Colin Ian King (1):
nfsd: remove redundant assignment to variable len

Dai Ngo (3):
NFSD: refactoring v4 specific code to a helper in nfs4state.c
NFSD: keep track of the number of v4 clients in the system
NFSD: limit the number of v4 clients to 1024 per 1GB of system memory

Jeff Layton (5):
nfsd: eliminate the NFSD_FILE_BREAK_* flags
nfsd: silence extraneous printk on nfsd.ko insertion
NFSD: drop fh argument from alloc_init_deleg
NFSD: verify the opened dentry after setting a delegation
lockd: detect and reject lock arguments that overflow

NeilBrown (11):
NFSD: introduce struct nfsd_attrs
NFSD: set attributes when creating symlinks
NFSD: add security label to struct nfsd_attrs
NFSD: add posix ACLs to struct nfsd_attrs
NFSD: change nfsd_create()/nfsd_symlink() to unlock directory before returning.
NFSD: always drop directory lock in nfsd_unlink()
NFSD: only call fh_unlock() once in nfsd_link()
NFSD: reduce locking in nfsd_lookup()
NFSD: use explicit lock/unlock for directory ops
NFSD: use (un)lock_inode instead of fh_(un)lock for file operations
NFSD: discard fh_locked flag and fh_lock/fh_unlock

Zhang Jiaming (1):
NFSD: Fix space and spelling mistake

Documentation/fault-injection/fault-injection.rst | 7 +
fs/lockd/svc4proc.c | 12 +-
fs/lockd/svclock.c | 10 +-
fs/lockd/svcproc.c | 5 +-
fs/lockd/xdr4.c | 19 +--
fs/nfsd/acl.h | 6 +-
fs/nfsd/filecache.c | 745 +++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------
fs/nfsd/filecache.h | 11 +-
fs/nfsd/netns.h | 3 +
fs/nfsd/nfs2acl.c | 6 +-
fs/nfsd/nfs3acl.c | 4 +-
fs/nfsd/nfs3proc.c | 35 ++--
fs/nfsd/nfs4acl.c | 46 +-----
fs/nfsd/nfs4callback.c | 37 +++--
fs/nfsd/nfs4proc.c | 330 ++++++++++++++++++--------------------
fs/nfsd/nfs4state.c | 127 ++++++++++++---
fs/nfsd/nfs4xdr.c | 123 +++++++--------
fs/nfsd/nfsctl.c | 21 +--
fs/nfsd/nfsd.h | 6 +
fs/nfsd/nfsfh.c | 27 +++-
fs/nfsd/nfsfh.h | 58 +------
fs/nfsd/nfsproc.c | 27 +++-
fs/nfsd/state.h | 1 -
fs/nfsd/trace.h | 327 +++++++++++++++++++++++++++++++++-----
fs/nfsd/vfs.c | 256 +++++++++++++++---------------
fs/nfsd/vfs.h | 33 +++-
fs/nfsd/xdr4.h | 60 +++++--
include/linux/lockd/lockd.h | 1 +
include/linux/lockd/xdr.h | 2 +
include/linux/nfs_ssc.h | 2 +-
include/linux/sunrpc/xdr.h | 4 +-
include/trace/events/sunrpc.h | 14 +-
net/sunrpc/svc_xprt.c | 2 +-
33 files changed, 1424 insertions(+), 943 deletions(-)
--
Chuck Lever