From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Chandan Babu R <chandan.babu@oracle.com>,
Brian Foster <bfoster@redhat.com>,
Dave Chinner <david@fromorbit.com>,
Sam Sun <samsun1006219@gmail.com>,
linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/3] xfs: restrict the h_size fixup in xlog_do_recovery_pass
Date: Mon, 29 Apr 2024 08:55:44 -0700 [thread overview]
Message-ID: <20240429155544.GE360919@frogsfrogsfrogs> (raw)
In-Reply-To: <20240429070200.1586537-3-hch@lst.de>
On Mon, Apr 29, 2024 at 09:01:59AM +0200, Christoph Hellwig wrote:
> The reflink and rmap features require a fixed xfsprogs, so don't allow
> this fixup for them.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> fs/xfs/xfs_log_recover.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
> index bb8957927c3c2e..d73bec65f93b46 100644
> --- a/fs/xfs/xfs_log_recover.c
> +++ b/fs/xfs/xfs_log_recover.c
> @@ -3040,10 +3040,14 @@ xlog_do_recovery_pass(
> * Detect this condition here. Use lsunit for the buffer size as
> * long as this looks like the mkfs case. Otherwise, return an
> * error to avoid a buffer overrun.
> + *
> + * Reject the invalid size if the file system has new enough
> + * features that require a fixed mkfs.
> */
> h_size = be32_to_cpu(rhead->h_size);
> h_len = be32_to_cpu(rhead->h_len);
> - if (h_len > h_size && h_len <= log->l_mp->m_logbsize &&
> + if (!xfs_has_reflink(log->l_mp) && xfs_has_reflink(log->l_mp) &&
> + h_len > h_size && h_len <= log->l_mp->m_logbsize &&
> rhead->h_num_logops == cpu_to_be32(1)) {
Same comment about do you want to test for rmap and reflink here?
I also wonder if this multiline predicate should turn into a static
inline helper. I nearly wrote you one, but then I realize that I don't
remember enough about the xfsprogs problem to know if the problem was
limited to mkfs, or if xfs_repair zeroing the log would also write out a
bad h_size?
--D
> xfs_warn(log->l_mp,
> "invalid iclog size (%d bytes), using lsunit (%d bytes)",
> --
> 2.39.2
>
>
next prev parent reply other threads:[~2024-04-29 15:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-29 7:01 fix h_size validation Christoph Hellwig
2024-04-29 7:01 ` [PATCH 1/3] xfs: fix log recovery buffer allocation for the legacy h_size fixup Christoph Hellwig
2024-04-29 12:18 ` Brian Foster
2024-04-29 17:13 ` Christoph Hellwig
2024-04-29 15:53 ` Darrick J. Wong
2024-04-29 7:01 ` [PATCH 2/3] xfs: restrict the h_size fixup in xlog_do_recovery_pass Christoph Hellwig
2024-04-29 12:18 ` Brian Foster
2024-04-29 17:15 ` Christoph Hellwig
2024-04-30 10:59 ` Brian Foster
2024-05-10 12:34 ` Brian Foster
2024-04-29 15:55 ` Darrick J. Wong [this message]
2024-04-29 7:02 ` [PATCH 3/3] xfs: clean up buffer allocation " Christoph Hellwig
2024-04-29 12:18 ` Brian Foster
2024-04-29 15:56 ` Darrick J. Wong
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=20240429155544.GE360919@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=bfoster@redhat.com \
--cc=chandan.babu@oracle.com \
--cc=david@fromorbit.com \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
--cc=samsun1006219@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 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.