From: Christoph Hellwig <hch@lst.de>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>,
Andrey Albershteyn <aalbersh@kernel.org>,
linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/3] libxfs: don't set mp->m_rtdev_targp when no RT devices is provided
Date: Fri, 11 Sep 2026 17:38:05 +0200 [thread overview]
Message-ID: <20260911153805.GA27644@lst.de> (raw)
In-Reply-To: <20260911153026.GF6265@frogsfrogsfrogs>
On Fri, Sep 11, 2026 at 08:30:26AM -0700, Darrick J. Wong wrote:
> > And that is what we get with this patch. The zeroing is done by
> > zeroing the entire mount structure in the callers of libxfs_mount
> > (don't ask me why..).
>
> Sorry, but I don't see how we get to m_rtdev_targp==NULL with this
> patch? The end of libxfs_buftarg_init becomes:
...
> In the case where the rt and data devices are not the same, we create a
> new buftarg object, even if xi->rt.dev == 0. That only happens if we
> didn't set xi->rt.name to a path, which means that libxfs_device_open
> ignores it:
Yeah, you're right. We'll have a separate m_rtdev_targp, but it
will have a NULL dev. rtmount_init rejects this except for xfs_db,
but xfs_db can see a "weird" targp.
> OTOH there are other places that use other checks that clearly assume
> that m_rtdev_targp is always present:
>
> libxfs/init.c:311: if (mp->m_rtdev_targp->bt_bdev == 0 && !xfs_is_debugger(mp)) {
> libxfs/init.c:1034: if (mp->m_rtdev_targp != mp->m_ddev_targp)
> libxfs/init.c:1035: libxfs_buftarg_free(mp->m_rtdev_targp);
>
> Ok maybe this patch is fine as-is? But xfsprogs needs a treewide change
> to make the "do we have a rt device attached?" checks match the kernel
> code?
It has passed pretty extensive testing so it must be perfect (TM).
But I agree that another cleanup pass to better match the kernel
sounds like a good idea. I'll add it to my bucket list.
next prev parent reply other threads:[~2026-09-11 15:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-11 14:45 fix missing RT detection in libxfs Christoph Hellwig
2026-09-11 14:45 ` [PATCH 1/3] libxfs: don't set mp->m_rtdev_targp when no RT devices is provided Christoph Hellwig
2026-09-11 14:57 ` Darrick J. Wong
2026-09-11 15:11 ` Christoph Hellwig
2026-09-11 15:30 ` Darrick J. Wong
2026-09-11 15:38 ` Christoph Hellwig [this message]
2026-09-11 14:45 ` [PATCH 2/3] libxfs: better describe why m_ddev_targp can be set in libxfs_buftarg_init Christoph Hellwig
2026-09-11 14:53 ` Darrick J. Wong
2026-09-11 14:45 ` [PATCH 3/3] libxfs: remove buftarg member aliases Christoph Hellwig
2026-09-11 14:53 ` 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=20260911153805.GA27644@lst.de \
--to=hch@lst.de \
--cc=aalbersh@kernel.org \
--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 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.