From: Dave Chinner <david@fromorbit.com>
To: John Garry <john.g.garry@oracle.com>
Cc: "Darrick J. Wong" <djwong@kernel.org>,
chandan.babu@oracle.com, dchinner@redhat.com, hch@lst.de,
viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz,
linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org, catherine.hoang@oracle.com,
martin.petersen@oracle.com
Subject: Re: [PATCH v2 07/13] xfs: Introduce FORCEALIGN inode flag
Date: Fri, 12 Jul 2024 09:33:34 +1000 [thread overview]
Message-ID: <ZpBrzntUOVjJgsh7@dread.disaster.area> (raw)
In-Reply-To: <d4474c49-1000-4553-bd21-c0a9ad41bba4@oracle.com>
On Thu, Jul 11, 2024 at 08:17:26AM +0100, John Garry wrote:
> On 11/07/2024 03:59, Darrick J. Wong wrote:
> > On Fri, Jul 05, 2024 at 04:24:44PM +0000, John Garry wrote:
> > > +/* Validate the forcealign inode flag */
> > > +xfs_failaddr_t
> > > +xfs_inode_validate_forcealign(
> > > + struct xfs_mount *mp,
> > > + uint32_t extsize,
> > > + uint32_t cowextsize,
> > > + uint16_t mode,
> > > + uint16_t flags,
> > > + uint64_t flags2)
> > > +{
> > > + bool rt = flags & XFS_DIFLAG_REALTIME;
> > > +
> > > + /* superblock rocompat feature flag */
> > > + if (!xfs_has_forcealign(mp))
> > > + return __this_address;
> > > +
> > > + /* Only regular files and directories */
> > > + if (!S_ISDIR(mode) && !S_ISREG(mode))
> > > + return __this_address;
> > > +
> > > + /* We require EXTSIZE or EXTSZINHERIT */
> > > + if (!(flags & (XFS_DIFLAG_EXTSIZE | XFS_DIFLAG_EXTSZINHERIT)))
> > > + return __this_address;
> > > +
> > > + /* We require a non-zero extsize */
> > > + if (!extsize)
> > > + return __this_address;
> > > +
> > > + /* Reflink'ed disallowed */
> > > + if (flags2 & XFS_DIFLAG2_REFLINK)
> > > + return __this_address;
> >
> > Hmm. If we don't support reflink + forcealign ATM, then shouldn't the
> > superblock verifier or xfs_fs_fill_super fail the mount so that old
> > kernels won't abruptly emit EFSCORRUPTED errors if a future kernel adds
> > support for forcealign'd cow and starts writing out files with both
> > iflags set?
>
> Fine, I see that we do something similar now for rtdev.
>
> However why even have the rt inode check, below, to disallow for reflink cp
> for rt inode (if we can't even mount with rt and reflink together)?
In theory we should be able to have reflink enabled on a filesystem
with an RT device right now - we just can't share extents on a rt
inode. Extent sharing should till work just fine on non-rt files,
but the overall config is disallowed at mount time because we
haven't ever tested that configuration. I'm not sure that mkfs.xfs
even allows you to make a filesystem of that config....
That said, it's good practice for the ->remap_file_range()
implementation (and anything else using shared extents) to be
explicitly checking for and preventing extent sharing on RT inodes.
THose operations don't support that config, and so should catch any
attempt that is made to do so and error out. It doesn't matter that
we have mount time checks, the checks in the extent sharing code
explicitly document that it doesn't support RT inodes right now...
-Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2024-07-11 23:33 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-05 16:24 [PATCH v2 00/13] forcealign for xfs John Garry
2024-07-05 16:24 ` [PATCH v2 01/13] xfs: only allow minlen allocations when near ENOSPC John Garry
2024-07-05 16:24 ` [PATCH v2 02/13] xfs: always tail align maxlen allocations John Garry
2024-07-05 16:24 ` [PATCH v2 03/13] xfs: simplify extent allocation alignment John Garry
2024-07-05 16:24 ` [PATCH v2 04/13] xfs: make EOF allocation simpler John Garry
2024-08-06 18:58 ` Darrick J. Wong
2024-07-05 16:24 ` [PATCH v2 05/13] xfs: introduce forced allocation alignment John Garry
2024-07-05 16:24 ` [PATCH v2 06/13] xfs: align args->minlen for " John Garry
2024-07-05 16:24 ` [PATCH v2 07/13] xfs: Introduce FORCEALIGN inode flag John Garry
2024-07-11 2:59 ` Darrick J. Wong
2024-07-11 3:59 ` Christoph Hellwig
2024-07-11 7:17 ` John Garry
2024-07-11 23:33 ` Dave Chinner [this message]
2024-07-11 23:20 ` Dave Chinner
2024-07-12 4:56 ` Christoph Hellwig
2024-07-18 8:53 ` John Garry
2024-07-23 10:11 ` John Garry
2024-07-23 14:42 ` Christoph Hellwig
2024-07-23 15:01 ` John Garry
2024-07-23 22:26 ` Darrick J. Wong
2024-07-26 14:14 ` John Garry
2024-07-23 23:38 ` Dave Chinner
2024-07-24 0:04 ` Darrick J. Wong
2024-07-24 18:50 ` John Garry
2024-07-24 7:39 ` John Garry
2024-07-05 16:24 ` [PATCH v2 08/13] xfs: Do not free EOF blocks for forcealign John Garry
2024-07-06 7:56 ` Christoph Hellwig
2024-07-08 1:44 ` Dave Chinner
2024-07-08 7:36 ` John Garry
2024-07-08 11:12 ` Dave Chinner
2024-07-08 14:41 ` John Garry
2024-07-09 7:41 ` Christoph Hellwig
2024-07-05 16:24 ` [PATCH v2 09/13] xfs: Update xfs_inode_alloc_unitsize() " John Garry
2024-07-05 16:24 ` [PATCH v2 10/13] xfs: Unmap blocks according to forcealign John Garry
2024-07-06 7:58 ` Christoph Hellwig
2024-07-08 14:48 ` John Garry
2024-07-09 7:46 ` Christoph Hellwig
2024-07-17 15:24 ` John Garry
2024-07-17 16:42 ` Christoph Hellwig
2024-07-09 9:57 ` Dave Chinner
2024-07-09 11:19 ` Christoph Hellwig
2024-07-05 16:24 ` [PATCH v2 11/13] xfs: Only free full extents for forcealign John Garry
2024-07-06 7:59 ` Christoph Hellwig
2024-07-05 16:24 ` [PATCH v2 12/13] xfs: Don't revert allocated offset " John Garry
2024-07-05 16:24 ` [PATCH v2 13/13] xfs: Enable file data forcealign feature John Garry
2024-07-06 7:53 ` [PATCH v2 00/13] forcealign for xfs Christoph Hellwig
2024-07-08 7:48 ` John Garry
2024-07-09 7:48 ` 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=ZpBrzntUOVjJgsh7@dread.disaster.area \
--to=david@fromorbit.com \
--cc=brauner@kernel.org \
--cc=catherine.hoang@oracle.com \
--cc=chandan.babu@oracle.com \
--cc=dchinner@redhat.com \
--cc=djwong@kernel.org \
--cc=hch@lst.de \
--cc=jack@suse.cz \
--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=viro@zeniv.linux.org.uk \
/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