From: Bill O'Donnell <bodonnel@redhat.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Dave Chinner <david@fromorbit.com>, xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] xfs: require a relatively recent V5 filesystem for LARP mode
Date: Fri, 1 Sep 2023 10:13:53 -0500 [thread overview]
Message-ID: <ZPH/sV8y77RJ6iqn@redhat.com> (raw)
In-Reply-To: <20230901050739.GO28186@frogsfrogsfrogs>
On Thu, Aug 31, 2023 at 10:07:39PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> While reviewing the FIEXCHANGE code in XFS, I realized that the function
> that enables logged xattrs doesn't actually check that the superblock
> has a LOG_INCOMPAT feature bit field. Add a check to refuse the
> operation if we don't have a V5 filesystem...
>
> ...but on second though, let's require either reflink or rmap so that we
> only have to deal with LARP mode on relatively /modern/ kernel. 4.14 is
> about as far back as I feel like going.
>
> Seeing as LARP is a debugging-only option anyway, this isn't likely to
> affect any real users.
>
> Fixes: d9c61ccb3b09 ("xfs: move xfs_attr_use_log_assist out of xfs_log.c")
> Really-Fixes: f3f36c893f26 ("xfs: Add xfs_attr_set_deferred and xfs_attr_remove_deferred")
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>
> ---
> fs/xfs/xfs_xattr.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/fs/xfs/xfs_xattr.c b/fs/xfs/xfs_xattr.c
> index 43e5c219aaed..a3975f325f4e 100644
> --- a/fs/xfs/xfs_xattr.c
> +++ b/fs/xfs/xfs_xattr.c
> @@ -46,6 +46,17 @@ xfs_attr_grab_log_assist(
> if (xfs_sb_version_haslogxattrs(&mp->m_sb))
> return 0;
>
> + /*
> + * Check if the filesystem featureset is new enough to set this log
> + * incompat feature bit. Strictly speaking, the minimum requirement is
> + * a V5 filesystem for the superblock field, but we'll require rmap
> + * or reflink to avoid having to deal with really old kernels.
> + */
> + if (!xfs_has_reflink(mp) && !xfs_has_rmapbt(mp)) {
> + error = -EOPNOTSUPP;
> + goto drop_incompat;
> + }
> +
> /* Enable log-assisted xattrs. */
> error = xfs_add_incompat_log_feature(mp,
> XFS_SB_FEAT_INCOMPAT_LOG_XATTRS);
>
prev parent reply other threads:[~2023-09-01 15:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-01 5:07 [PATCH] xfs: require a relatively recent V5 filesystem for LARP mode Darrick J. Wong
2023-09-01 15:13 ` Bill O'Donnell [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=ZPH/sV8y77RJ6iqn@redhat.com \
--to=bodonnel@redhat.com \
--cc=david@fromorbit.com \
--cc=djwong@kernel.org \
--cc=linux-xfs@vger.kernel.org \
/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