summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2026-10-12 23:08:35 -0700
committerCarlos Maiolino <cem@kernel.org>2026-10-14 10:13:51 +0200
commitc9f98b0f4f70c8cfd617dc2886bf2fc0a36ab9da (patch)
tree583723eaca4915d7fd8e89c45895e97e6eb39eca
parent03ce4ca43c00394364493865f417d646e252bac2 (diff)
downloadlinux-next-c9f98b0f4f70c8cfd617dc2886bf2fc0a36ab9da.tar.gz
linux-next-c9f98b0f4f70c8cfd617dc2886bf2fc0a36ab9da.zip
xfs: don't set a metadata directory's parent to sb_rootino
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 <djwong@kernel.org> Assisted-by: LOLLM # finding obvious bugs Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Carlos Maiolino <cem@kernel.org>
-rw-r--r--fs/xfs/scrub/dir_repair.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/xfs/scrub/dir_repair.c b/fs/xfs/scrub/dir_repair.c
index 6dae79668d31..c851d62b1d98 100644
--- a/fs/xfs/scrub/dir_repair.c
+++ b/fs/xfs/scrub/dir_repair.c
@@ -1662,7 +1662,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;
}
/*