Linux-NFS Archive mirror
 help / color / mirror / Atom feed
From: Dai Ngo <dai.ngo@oracle.com>
To: Christoph Hellwig <hch@infradead.org>,
	"Darrick J. Wong" <djwong@kernel.org>
Cc: Dave Chinner <dgc@kernel.org>,
	cem@kernel.org, linux-xfs@vger.kernel.org,
	linux-nfs@vger.kernel.org,
	Sergey Bashirov <sergeybashirov@gmail.com>
Subject: Re: [PATCH 1/1] xfs: fix overlapping extents returned for pNFS LAYOUTGET
Date: Wed, 20 May 2026 08:09:29 -0700	[thread overview]
Message-ID: <e55a29a9-ed18-4e3a-8378-f712bcbc940f@oracle.com> (raw)
In-Reply-To: <ag1vwFHoYatausLK@infradead.org>


On 5/20/26 1:24 AM, Christoph Hellwig wrote:
> [adding Sergey, who wrote the code to allow multiple mappings]
>
> On Tue, May 19, 2026 at 07:59:49AM -0700, Darrick J. Wong wrote:
>> 1) xfs_fs_map_blocks only takes i_rwsem and XFS_ILOCK; it doesn't take
>> the mmap invalidation lock.  Does that mean that pagefaults could wander
>> in and mess with the layout?
> Looks like it.

I already described the scenario in which the file mapping can change
between successive calls from nfsd—triggered by a single LAYOUTGET
request—to xfs_fs_map_blocks().

I also don't see how page faults are relevant in the context of pNFS
layouts. The server is not servicing actual data accesses through page
faults when constructing a LAYOUTGET response

>
>> 2) Now that NFS apparently can serve up multiple mappings at once,
>> should ->map_blocks pass in an array element count so that we can do
>> multiple iomaps in a single lock cycle?
> I guess we need to do that, or revert the code to provide multiple maps
> for now.

I think we should address the immediate problem first by replacing XFS_BMAPI_ENTIRE
with 0, and handle support for returning multiple map entries from a single
call to xfs_fs_map_blocks() in follow-up patches. That work is more involved,
as it requires coordinated changes in both the nfsd and XFS code.

>
>> 3) Do the reflink and realtime inode checks need to be re-assessed after
>> grabbing the ilock since they can change?
> Yes.

I can move the check for reflink and realtime inode inside the ilock in v2
of this patch series.

-Dai


  reply	other threads:[~2026-05-20 15:10 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12 17:21 [PATCH 1/1] xfs: fix overlapping extents returned for pNFS LAYOUTGET Dai Ngo
2026-05-12 17:34 ` Darrick J. Wong
2026-05-12 19:21   ` Dai Ngo
2026-05-13  7:01 ` Christoph Hellwig
2026-05-13 15:50   ` Dai Ngo
2026-05-13 17:28     ` Dai Ngo
2026-05-14  0:25       ` Darrick J. Wong
2026-05-14 17:19         ` Dai Ngo
2026-05-14 17:49           ` Darrick J. Wong
2026-05-15 21:39           ` Dave Chinner
2026-05-16  2:14             ` Dai Ngo
2026-05-18  5:09               ` Christoph Hellwig
2026-05-18 19:55                 ` Dai Ngo
2026-05-19  6:30                   ` Christoph Hellwig
2026-05-19 13:44                     ` Dai Ngo
2026-05-19 14:59                       ` Darrick J. Wong
2026-05-19 17:34                         ` Dai Ngo
2026-05-20  8:24                         ` Christoph Hellwig
2026-05-20 15:09                           ` Dai Ngo [this message]
2026-05-20 16:48                             ` Darrick J. Wong
2026-05-20 17:32                               ` Dai Ngo
2026-05-20 22:08                                 ` Sergey Bashirov
2026-05-15 11:50       ` Christoph Hellwig
2026-05-15 11:49     ` Christoph Hellwig

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=e55a29a9-ed18-4e3a-8378-f712bcbc940f@oracle.com \
    --to=dai.ngo@oracle.com \
    --cc=cem@kernel.org \
    --cc=dgc@kernel.org \
    --cc=djwong@kernel.org \
    --cc=hch@infradead.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sergeybashirov@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).