From: Christoph Hellwig <hch@infradead.org>
To: Chris Wedgwood <cw@f00f.org>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 5/9] libxlog: import the kernel's log recovery, log items and AIL
Date: Mon, 31 Aug 2026 06:45:08 -0700 [thread overview]
Message-ID: <apWFZAYCqGb5QRjy@infradead.org> (raw)
In-Reply-To: <49d9d6c177ed570d0ee5668df8a6d65ac3a27c6b.1788110147.git.cw@f00f.org>
On Wed, Aug 26, 2026 at 10:09:03PM -0700, Chris Wedgwood wrote:
> xfs_repair cannot replay a dirty log. The code that can is in the
> kernel, and xfsprogs already carries kernel code rather than
> reimplementing it, so import it.
>
> libxfs/ mirrors the kernel's fs/xfs/libxfs/ and these files are not from
> there; they are from the top level of fs/xfs. They go in libxlog/,
> which is where this tree keeps log code, so that each directory has one
> kernel counterpart and tools/libxfs-diff can check both.
>
> The files are copied from Linux v7.1 and are byte-identical to their
> kernel counterparts apart from their #include lists, which is the
> adaptation libxfs has always used. v7.1 is the kernel this tree's
> libxfs/ is currently in sync with: comparing xfsprogs libxfs/ against
> v7.1 reports no difference in any of 102 files, while against v7.2 it
As in changes except for the include file mess ignored by libxfs-diff?
Because otherwise we should have a lot more..
> reports 33. Importing from a newer kernel than libxfs/ is synced to
> would mix two kernel versions in one tree.
We're about to merge the 7.2 merge. Either way we'll need to coordinate
them.
> diff --git a/include/kernel_compat.h b/include/kernel_compat.h
> new file mode 100644
> index 00000000..0dbb2800
> --- /dev/null
> +++ b/include/kernel_compat.h
> @@ -0,0 +1,231 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Kernel infrastructure that xfs kernel sources refer to but which has no
> + * userspace equivalent.
> + *
> + * libxfs adapts kernel sources by rewriting their include list and nothing
> + * else, so the annotations, types and helpers those sources use have to be
> + * supplied from outside them. Concurrency primitives collapse to no-ops
> + * because libxfs is single-threaded with respect to the log, and the
> + * deferred-work and I/O types only ever appear as struct members that
> + * userspace never schedules or submits.
> + *
> + * This header is included both by libxfs internals (via xfs_platform.h) and
> + * by the tools (via libxfs.h), because struct xlog embeds several of these
> + * types and the tools inspect struct xlog directly.
Please split this out into a separate patch, and make sure all the
other kernel compat bits are consistent with this.
Also usually kernel files need some amount of changes
next prev parent reply other threads:[~2026-08-31 13:45 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-30 17:15 [PATCH 0/9] xfsprogs: add xfs_repair -R --- log replay Chris Wedgwood
2026-08-21 0:22 ` [PATCH 1/9] libxfs: make XBF_DONE actually mark a buffer uptodate Chris Wedgwood
2026-08-31 13:37 ` Christoph Hellwig
2026-08-21 0:26 ` [PATCH 2/9] libxfs: don't corrupt a delwri list when a buffer is queued twice Chris Wedgwood
2026-08-31 13:38 ` Christoph Hellwig
2026-08-21 5:42 ` [PATCH 3/9] libxfs: record a failed buffer write when it fails Chris Wedgwood
2026-08-31 13:39 ` Christoph Hellwig
2026-08-27 5:08 ` [PATCH 6/9] libxfs-diff: also compare libxlog against the kernel Chris Wedgwood
2026-08-31 13:40 ` Christoph Hellwig
2026-08-31 17:37 ` Darrick J. Wong
2026-09-02 23:25 ` Dave Chinner
2026-08-27 5:08 ` [PATCH 4/9] libxlog: rename xfs_log_recover.c to logscan.c Chris Wedgwood
2026-08-31 13:42 ` Christoph Hellwig
2026-08-27 5:09 ` [PATCH 5/9] libxlog: import the kernel's log recovery, log items and AIL Chris Wedgwood
2026-08-31 13:45 ` Christoph Hellwig [this message]
2026-09-02 23:48 ` Dave Chinner
2026-08-27 5:24 ` [PATCH 7/9] libxlog: build the imported kernel code Chris Wedgwood
2026-08-31 13:46 ` Christoph Hellwig
2026-08-27 5:25 ` [PATCH 8/9] xfs_repair: add -R to replay a dirty log before repairing Chris Wedgwood
2026-08-31 13:48 ` Christoph Hellwig
2026-09-02 23:57 ` Dave Chinner
2026-08-27 5:48 ` [PATCH 9/9] xfs_repair: finish deletions the crash interrupted Chris Wedgwood
2026-08-31 13:50 ` Christoph Hellwig
2026-08-31 13:36 ` [PATCH 0/9] xfsprogs: add xfs_repair -R --- log replay 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=apWFZAYCqGb5QRjy@infradead.org \
--to=hch@infradead.org \
--cc=cw@f00f.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