Re: [PATCH 5/6] xfs: adjust datadev sector count to reflect internal rt volumes

Christoph Hellwig <[email protected]> Thu, 30 Jul 2026 10:22:04 +0200
Newsgroups org.kernel.vger.linux-xfs,org.kernel.vger.stable
Message-ID <[email protected]>
On Wed, Jul 29, 2026 at 10:27:20PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <[email protected]>
> 
> A media scan of a filesystem containing an internal rt volume produced
> an error in xfs_scrub phase 6 complaining about a truncated realtime
> device.  The rt device wasn't truncated, but the media scan code thought
> we were trying to start a scan past the end of m_rtdev_targp.  That in
> turn is an alias for m_ddev_targp, but in xfs_configure_buftarg we set
> nr_sectors to the size of the data section.  Oops.
> 
> On these filesystems, the internal rt section comes immediately after
> the data section.  We need to set the sector count for the data device
> buftarg to the size of both sections.  Without this, media scans don't
> work and media failure notifications from the kernel will be discarded
> silently.
> 
> We also need to fix the superblock buffer recovery code to do the same.

This feels wrong.  Nothing should acess the internal rtdev through
the data device buftarg.

Is this an LLM report bug, or did you actually run it using scrub?  If
so can you help with the reproducer?