Re: [PATCH 6/6] xfs: adjust datadev sector count to reflect internal rt volumes
Christoph Hellwig <[email protected]>
| Newsgroups | org.kernel.vger.linux-xfs,org.kernel.vger.stable |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Aug 12, 2026 at 10:25:25PM -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. Can you share your reproducer for this? > > 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. I still think messing with the kernel buftarg nr_sectors is wrong for this. The kernel view of the buftarg should be correct and just include the part of the device that matters. So I think the right fix in the kernel is changing xfs_verify_media to add the internal RT device offset before sending the bios. We might need additional userland fixes, but from a quick look I think it should be fine (famous last words)