From: Dave Chinner <david@fromorbit.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>,
brauner@kernel.org, cem@kernel.org, dchinner@redhat.com,
hch@lst.de, ritesh.list@gmail.com, linux-xfs@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
martin.petersen@oracle.com
Subject: Re: [PATCH 1/4] iomap: Lift blocksize restriction on atomic writes
Date: Thu, 23 Jan 2025 08:05:00 +1100 [thread overview]
Message-ID: <Z5FdfFZWwlKGaVUD@dread.disaster.area> (raw)
In-Reply-To: <20250114235726.GA3566461@frogsfrogsfrogs>
On Tue, Jan 14, 2025 at 03:57:26PM -0800, Darrick J. Wong wrote:
> On Tue, Jan 14, 2025 at 03:41:13PM +1100, Dave Chinner wrote:
> > On Wed, Dec 11, 2024 at 05:34:33PM -0800, Darrick J. Wong wrote:
> > > On Fri, Dec 06, 2024 at 08:15:05AM +1100, Dave Chinner wrote:
> > > > On Thu, Dec 05, 2024 at 10:52:50AM +0000, John Garry wrote:
> Tricky questions: How do we avoid collisions between overlapping writes?
> I guess we find a free file range at the top of the file that is long
> enough to stage the write, and put it there? And purge it later?
Use xfs_bmap_last_offset() to find the last used block in the file,
locate the block we are operating on beyond that. If done under the
ILOCK_EXCL, then this can't race against other attempts to create
a post-EOF extent for an atomic write swap, and it's safe against
other atomic writes in progress.
i.e. we don't really need anything special to create a temporary
post-EOF extent.
> Also, does this imply that the maximum file size is less than the usual
> 8EB?
Maybe. Depends on implementation details, I think.
I think The BMBT on-disk record format can handle offsets beyond
8EiB, so the question remains how we stage the data for the IO into
that extent before we swap it over. The mapping tree index is
actually unsigned, we are limited to 8EiB by loff_t being signed,
not by XFS or the mapping tree being unable to index beyond 8EiB
safely...
> (There's also the question about how to do this with buffered writes,
> but I guess we could skip that for now.)
yup, that's kinda what I meant by "implementation details"...
-Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2025-01-22 21:05 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-04 15:43 [PATCH 0/4] large atomic writes for xfs John Garry
2024-12-04 15:43 ` [PATCH 1/4] iomap: Lift blocksize restriction on atomic writes John Garry
2024-12-04 20:35 ` Dave Chinner
2024-12-05 6:30 ` Darrick J. Wong
2024-12-05 11:51 ` John Garry
2024-12-05 10:52 ` John Garry
2024-12-05 21:15 ` Dave Chinner
2024-12-06 9:43 ` John Garry
2024-12-12 1:34 ` Darrick J. Wong
2025-01-14 4:41 ` Dave Chinner
2025-01-14 23:57 ` Darrick J. Wong
2025-01-15 9:30 ` John Garry
2025-01-16 6:52 ` Christoph Hellwig
2025-01-17 18:49 ` Darrick J. Wong
2025-01-22 6:42 ` Christoph Hellwig
2025-01-22 10:45 ` John Garry
2025-01-22 23:51 ` Dave Chinner
2025-01-23 9:28 ` John Garry
2025-01-17 10:26 ` John Garry
2025-01-17 18:29 ` Darrick J. Wong
2025-01-20 8:29 ` John Garry
2025-01-22 21:05 ` Dave Chinner [this message]
2025-01-13 21:35 ` John Garry
2025-01-14 4:43 ` Dave Chinner
2024-12-04 15:43 ` [PATCH 2/4] xfs: Switch atomic write size check in xfs_file_write_iter() John Garry
2024-12-04 15:43 ` [PATCH 3/4] xfs: Add RT atomic write unit max to xfs_mount John Garry
2024-12-04 15:43 ` [PATCH 4/4] xfs: Update xfs_get_atomic_write_attr() for large atomic writes John Garry
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=Z5FdfFZWwlKGaVUD@dread.disaster.area \
--to=david@fromorbit.com \
--cc=brauner@kernel.org \
--cc=cem@kernel.org \
--cc=dchinner@redhat.com \
--cc=djwong@kernel.org \
--cc=hch@lst.de \
--cc=john.g.garry@oracle.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=ritesh.list@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