All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@kernel.org>
To: Anna Schumaker <anna.schumaker@oracle.com>
Cc: Anna Schumaker <anna@kernel.org>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	Chuck Lever <chuck.lever@oracle.com>,
	linux-nfs@vger.kernel.org
Subject: Re: [GIT PULL v2] NFS LOCALIO O_DIRECT changes for Linux 6.18
Date: Wed, 1 Oct 2025 12:04:59 -0400	[thread overview]
Message-ID: <aN1RK55xjYEmXCUE@kernel.org> (raw)
In-Reply-To: <aNxL88GmEzJ5hsHl@kernel.org>

On Tue, Sep 30, 2025 at 05:30:27PM -0400, Mike Snitzer wrote:
> On Tue, Sep 30, 2025 at 04:53:49PM -0400, Anna Schumaker wrote:
> > Hi Mike,
> > 
> > On 9/30/25 3:32 PM, Mike Snitzer wrote:
> > > Hi Anna,
> > > 
> > > Given that my NFS LOCALIO O_DIRECT changes depend on NFSD changes
> > > which will be included in the NFSD pull request for 6.18, I figured it
> > > worth proposing a post-NFSD-merge pull request for your consideration
> > > as the best way forward logistically (to ensure linux-next coverage,
> > > you could pull this in _before_ Chuck sends his pull to Linus).
> > 
> > I've applied your patches with the one NFSD patch acked-by Chuck and pushed
> > it out to my linux-next for a few days of wider testing. I agree with Chuck
> > that the remaining fixes can go in through an -rc once they're ready.
> 
> Perfect, thanks for the update.
> 
> Note that there will be merge conflicts that both linux-next and Linus
> will need to resolve.  Due to these nfsd-next commits:
> 
> c926f0298d3cd NFSD: Relocate the fh_want_write() and fh_drop_write() helpers
> c1f203e46c55a NFSD: Move the fh_getattr() helper
> 2ee3a75e42081 nfsd: discard nfsd_file_get_local() 

I looked to see that linux-next merges nfs before nfsd, so I inverted
the merge test:

$ git checkout -b nfs-merge-nfsd-next-6.18 anna-nfs/linux-next
branch 'nfs-merge-nfsd-next-6.18' set up to track 'anna-nfs/linux-next'.
Switched to a new branch 'nfs-merge-nfsd-next-6.18'

$ git merge cel/nfsd-next
Auto-merging fs/nfsd/filecache.c
Auto-merging fs/nfsd/filecache.h
Auto-merging fs/nfsd/localio.c
Auto-merging fs/nfsd/vfs.h
CONFLICT (content): Merge conflict in fs/nfsd/vfs.h
Auto-merging include/linux/nfslocalio.h
Auto-merging include/linux/sunrpc/svc_xprt.h
Auto-merging include/linux/sunrpc/xdr.h
Auto-merging net/sunrpc/svc.c
Auto-merging net/sunrpc/svc_xprt.c
Automatic merge failed; fix conflicts and then commit the result.

I've pushed the branch with my merge conflict resolution here:
https://git.kernel.org/pub/scm/linux/kernel/git/snitzer/linux.git/log/?h=nfs-merge-nfsd-next-6.18

Please feel free to point people at it as needed. As merge conflicts
go, pretty easy one.

Mike

ps. here is the merge commit:

$ git show a282c1cde64
commit a282c1cde643abab584a244076d94b575307301d
Merge: 1f0d4ab0f532 db155b7c7c85
Author: Mike Snitzer <snitzer@kernel.org>
Date:   Wed Oct 1 11:45:44 2025 -0400

    Merge remote-tracking branch 'cel/nfsd-next' into nfs-merge-nfsd-next-6.18
    
    Resolves merge conflict in fs/nfsd/nfsfh.c and fs/nfsd/vfs.h
    
    Signed-off-by: Mike Snitzer <snitzer@kernel.org>

diff --cc fs/nfsd/localio.c
index 9e0a37cd29d8,269fa9391dc4..be710d809a3b
--- 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 74cf1f4de174,062cfc18d8c6..0bc2608a80b0
--- a/fs/nfsd/nfsfh.c
+++ b/fs/nfsd/nfsfh.c
@@@ -662,6 -684,29 +684,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 7ca2715edccc,59ea90bd136b..3d91043254e6
--- 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);

      reply	other threads:[~2025-10-01 16:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-15 15:41 [PATCH v9 0/7] NFS DIRECT: align misaligned DIO for LOCALIO Mike Snitzer
2025-09-15 15:41 ` [PATCH v9 1/7] nfs/localio: make trace_nfs_local_open_fh more useful Mike Snitzer
2025-09-15 15:41 ` [PATCH v9 2/7] nfs/localio: avoid issuing misaligned IO using O_DIRECT Mike Snitzer
2025-09-15 15:41 ` [PATCH v9 3/7] nfs/localio: refactor iocb and iov_iter_bvec initialization Mike Snitzer
2025-09-15 15:41 ` [PATCH v9 4/7] nfs/localio: refactor iocb initialization further Mike Snitzer
2025-09-15 15:41 ` SYNCFrom cb702c86aa12e5477e1e4aca0c1384a821f2afef Mon Sep 17 00:00:00 2001 Mike Snitzer
2025-09-15 15:47   ` [PATCH v9 5/7] nfs/localio: add proper O_DIRECT support for READ and WRITE Mike Snitzer
2025-09-15 15:41 ` [PATCH v9 6/7] nfs/localio: add tracepoints for misaligned DIO READ and WRITE support Mike Snitzer
2025-09-15 15:41 ` [PATCH v9 7/7] NFS: add basic STATX_DIOALIGN and STATX_DIO_READ_ALIGN support Mike Snitzer
     [not found] ` <aMiMpYAcHV8bYU4W@kernel.org>
     [not found]   ` <aNLfroQ8Ti1Vh5wh@kernel.org>
     [not found]     ` <aNQqUprZ3DuJhMe4@kernel.org>
     [not found]       ` <aNgSOM9EzMS_Q6bR@kernel.org>
2025-09-30 16:26         ` [GIT PULL] NFS LOCALIO O_DIRECT changes for Linux 6.18 Mike Snitzer
2025-09-30 17:15           ` Chuck Lever
2025-09-30 17:35             ` Mike Snitzer
2025-09-30 17:59               ` Chuck Lever
2025-09-30 19:32           ` [GIT PULL v2] " Mike Snitzer
2025-09-30 20:53             ` Anna Schumaker
2025-09-30 21:30               ` Mike Snitzer
2025-10-01 16:04                 ` Mike Snitzer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aN1RK55xjYEmXCUE@kernel.org \
    --to=snitzer@kernel.org \
    --cc=anna.schumaker@oracle.com \
    --cc=anna@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@hammerspace.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.