7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Darrick J. Wong commit c9f98b0f4f70c8cfd617dc2886bf2fc0a36ab9da upstream. LOLLM complains that it's weird to set a metadata directory's parent inumber to the regular directory tree root. Fix this even if nobody's ever going to notice this because metadata path lookups don't access dotdot. Cc: stable@vger.kernel.org # v6.13 Fixes: 4f3d4dd1b04b2b ("xfs: define the on-disk format for the metadir feature") Signed-off-by: Darrick J. Wong Assisted-by: LOLLM # finding obvious bugs Reviewed-by: Christoph Hellwig Signed-off-by: Carlos Maiolino Signed-off-by: Greg Kroah-Hartman --- fs/xfs/scrub/dir_repair.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/fs/xfs/scrub/dir_repair.c +++ b/fs/xfs/scrub/dir_repair.c @@ -1674,7 +1674,10 @@ xrep_dir_swap( ASSERT(sc->ilock_flags & XFS_ILOCK_EXCL); if (rd->pscan.parent_ino == NULLFSINO) { rd->needs_adoption = true; - rd->pscan.parent_ino = rd->sc->mp->m_sb.sb_rootino; + if (xfs_is_metadir_inode(rd->sc->ip)) + rd->pscan.parent_ino = rd->sc->mp->m_sb.sb_metadirino; + else + rd->pscan.parent_ino = rd->sc->mp->m_sb.sb_rootino; } /*