From: Christoph Hellwig <hch@infradead.org>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Andrey Albershteyn <aalbersh@redhat.com>,
xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] xfs_mdrestore: fix restoration on filesystems with 4k sectors
Date: Tue, 6 Jan 2026 22:12:09 -0800 [thread overview]
Message-ID: <aV35OUeSf-g99rbY@infradead.org> (raw)
In-Reply-To: <20260106184827.GI191501@frogsfrogsfrogs>
On Tue, Jan 06, 2026 at 10:48:27AM -0800, Darrick J. Wong wrote:
> + /*
> + * The first block must be the primary super, which is at the start of
> + * the data device, which is device 0.
> + */
> + if (xme.xme_addr != 0)
> + fatal("Invalid superblock disk address 0x%llx\n",
> + be64_to_cpu(xme.xme_addr));
>
> len = BBTOB(be32_to_cpu(xme.xme_len));
>
> + /* The primary superblock is always a single filesystem sector. */
> + if (len < BBTOB(1) || len > 1U << XFS_MAX_SECTORSIZE_LOG)
I'd use XFS_MAX_SECTORSIZE here instead of open coding the shift.
Otherwise looks good.
next prev parent reply other threads:[~2026-01-07 6:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-06 18:48 [PATCH] xfs_mdrestore: fix restoration on filesystems with 4k sectors Darrick J. Wong
2026-01-07 6:12 ` Christoph Hellwig [this message]
2026-01-07 17:22 ` 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=aV35OUeSf-g99rbY@infradead.org \
--to=hch@infradead.org \
--cc=aalbersh@redhat.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