From: Linus Torvalds Date: Mon, 6 Oct 2025 20:22:21 +0000 (-0700) Subject: Merge tag 'nfsd-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=81538c8e42806eed71ce125723877a7c2307370c;p=thirdparty%2Fkernel%2Fstable.git Merge tag 'nfsd-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd updates from Chuck Lever: "Mike Snitzer has prototyped a mechanism for disabling I/O caching in NFSD. This is introduced in v6.18 as an experimental feature. This enables scaling NFSD in /both/ directions: - NFS service can be supported on systems with small memory footprints, such as low-cost cloud instances - Large NFS workloads will be less likely to force the eviction of server-local activity, helping it avoid thrashing Jeff Layton contributed a number of fixes to the new attribute delegation implementation (based on a pending Internet RFC) that we hope will make attribute delegation reliable enough to enable by default, as it is on the Linux NFS client. The remaining patches in this pull request are clean-ups and minor optimizations. Many thanks to the contributors, reviewers, testers, and bug reporters who participated during the v6.18 NFSD development cycle" * tag 'nfsd-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: (42 commits) nfsd: discard nfserr_dropit SUNRPC: Make RPCSEC_GSS_KRB5 select CRYPTO instead of depending on it NFSD: Add io_cache_{read,write} controls to debugfs NFSD: Do the grace period check in ->proc_layoutget nfsd: delete unnecessary NULL check in __fh_verify() NFSD: Allow layoutcommit during grace period NFSD: Disallow layoutget during grace period sunrpc: fix "occurence"->"occurrence" nfsd: Don't force CRYPTO_LIB_SHA256 to be built-in nfsd: nfserr_jukebox in nlm_fopen should lead to a retry NFSD: Reduce DRC bucket size NFSD: Delay adding new entries to LRU SUNRPC: Move the svc_rpcb_cleanup() call sites NFS: Remove rpcbind cleanup for NFSv4.0 callback nfsd: unregister with rpcbind when deleting a transport NFSD: Drop redundant conversion to bool sunrpc: eliminate return pointer in svc_tcp_sendmsg() sunrpc: fix pr_notice in svc_tcp_sendto() to show correct length nfsd: decouple the xprtsec policy check from check_nfsd_access() NFSD: Fix destination buffer size in nfsd4_ssc_setup_dul() ... --- 81538c8e42806eed71ce125723877a7c2307370c diff --cc fs/nfsd/localio.c index 9e0a37cd29d8a,269fa9391dc46..be710d809a3ba --- a/fs/nfsd/localio.c +++ b/fs/nfsd/localio.c @@@ -132,9 -122,7 +132,8 @@@ static const struct nfsd_localio_operat .nfsd_net_put = nfsd_net_put, .nfsd_open_local_fh = nfsd_open_local_fh, .nfsd_file_put_local = nfsd_file_put_local, - .nfsd_file_get_local = nfsd_file_get_local, .nfsd_file_file = nfsd_file_file, + .nfsd_file_dio_alignment = nfsd_file_dio_alignment, }; void nfsd_localio_ops_init(void) diff --cc fs/nfsd/nfsfh.c index 74cf1f4de1741,3edccc38db42e..3eb724ec95660 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c @@@ -662,6 -682,29 +682,33 @@@ out_negative return nfserr_serverfault; } + /** + * fh_getattr - Retrieve attributes on a local file + * @fhp: File handle of target file + * @stat: Caller-supplied kstat buffer to be filled in + * + * Returns nfs_ok on success, otherwise an NFS status code is + * returned. + */ + __be32 fh_getattr(const struct svc_fh *fhp, struct kstat *stat) + { + struct path p = { + .mnt = fhp->fh_export->ex_path.mnt, + .dentry = fhp->fh_dentry, + }; ++ struct inode *inode = d_inode(p.dentry); + u32 request_mask = STATX_BASIC_STATS; + ++ if (S_ISREG(inode->i_mode)) ++ request_mask |= (STATX_DIOALIGN | STATX_DIO_READ_ALIGN); ++ + if (fhp->fh_maxsize == NFS4_FHSIZE) + request_mask |= (STATX_BTIME | STATX_CHANGE_COOKIE); + + return nfserrno(vfs_getattr(&p, stat, request_mask, + AT_STATX_SYNC_AS_STAT)); + } + /** * fh_fill_pre_attrs - Fill in pre-op attributes * @fhp: file handle to be updated diff --cc include/linux/nfslocalio.h index 7ca2715edccca,59ea90bd136b6..3d91043254e64 --- a/include/linux/nfslocalio.h +++ b/include/linux/nfslocalio.h @@@ -63,10 -63,7 +63,9 @@@ struct nfsd_localio_operations struct nfsd_file __rcu **pnf, const fmode_t); struct net *(*nfsd_file_put_local)(struct nfsd_file __rcu **); - struct nfsd_file *(*nfsd_file_get_local)(struct nfsd_file *); struct file *(*nfsd_file_file)(struct nfsd_file *); + void (*nfsd_file_dio_alignment)(struct nfsd_file *, + u32 *, u32 *, u32 *); } ____cacheline_aligned; extern void nfsd_localio_ops_init(void);