On Wed, Aug 28, 2024 at 09:03:55PM -0400, Mike Snitzer wrote: > These latest changes are available in my git tree here: > https://git.kernel.org/pub/scm/linux/kernel/git/snitzer/linux.git/log/?h=nfs-localio-for-next > > I _think_ I addressed all of v13's very helpful review comments. > Special thanks to Neil and Chuck for their time and help! > > And hopefully I didn't miss anything in the changelog below. As it happens, a last minute rebase that I did just before sending out v14 caused me to send out 2 stale patches: [PATCH v14 09/25] nfsd: add nfsd_file_acquire_local() [PATCH v14 25/25] nfs: add FAQ section to Documentation/filesystems/nfs/localio.rst I will reply to each patch with a correct v14.5 for each. Sorry for the confusion. Here is the incremental diff that shows what was missing in v14: diff --git a/Documentation/filesystems/nfs/localio.rst b/Documentation/filesystems/nfs/localio.rst index 4b6d63246479..5d652f637a97 100644 --- a/Documentation/filesystems/nfs/localio.rst +++ b/Documentation/filesystems/nfs/localio.rst @@ -120,12 +120,13 @@ FAQ using RPC, beneficial? Is the benefit pNFS specific? Avoiding the use of XDR and RPC for file opens is beneficial to - performance regardless of whether pNFS is used. However adding a - requirement to go over the wire to do an open and/or close ends up - negating any benefit of avoiding the wire for doing the I/O itself - when we´re dealing with small files. There is no benefit to replacing - the READ or WRITE with a new open and/or close operation that still - needs to go over the wire. + performance regardless of whether pNFS is used. Especially when + dealing with small files its best to avoid going over the wire + whenever possible, otherwise it could reduce or even negate the + benefits of avoiding the wire for doing the small file I/O itself. + Given LOCALIO's requirements the current approach of having the + client perform a server-side file open, without using RPC, is ideal. + If in the future requirements change then we can adapt accordingly. 7. Why is LOCALIO only supported with UNIX Authentication (AUTH_UNIX)? diff --git a/fs/nfsd/lockd.c b/fs/nfsd/lockd.c index e636d2a1e664..46a7f9b813e5 100644 --- a/fs/nfsd/lockd.c +++ b/fs/nfsd/lockd.c @@ -32,10 +32,8 @@ nlm_fopen(struct svc_rqst *rqstp, struct nfs_fh *f, struct file **filp, int access; struct svc_fh fh; - if (rqstp->rq_vers == 4) - fh_init(&fh, NFS3_FHSIZE); - else - fh_init(&fh, NFS_FHSIZE); + /* must initialize before using! but maxsize doesn't matter */ + fh_init(&fh,0); fh.fh_handle.fh_size = f->size; memcpy(&fh.fh_handle.fh_raw, f->data, f->size); fh.fh_export = NULL; diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index 49468e478d23..eca577cf3263 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c @@ -290,9 +290,6 @@ static __be32 nfsd_set_fh_dentry(struct svc_rqst *rqstp, struct net *net, fhp->fh_use_wgather = true; if (exp->ex_flags & NFSEXP_V4ROOT) goto out; - break; - case 0: - WARN_ONCE(1, "Uninitialized file handle"); } return 0;