From: Darrick J. Wong <djwong@xxxxxxxxxx> On a filesystem with metadata directories, we only want to automatically mark the two root directories present because those are the only two statically allocated inode numbers -- the rt summary inode is now just a regular file in a directory. Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx> --- repair/phase5.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/repair/phase5.c b/repair/phase5.c index 361e5649b29..252442c9fd8 100644 --- a/repair/phase5.c +++ b/repair/phase5.c @@ -421,13 +421,14 @@ static void keep_fsinos(xfs_mount_t *mp) { ino_tree_node_t *irec; - int i; irec = find_inode_rec(mp, XFS_INO_TO_AGNO(mp, mp->m_sb.sb_rootino), XFS_INO_TO_AGINO(mp, mp->m_sb.sb_rootino)); - for (i = 0; i < 3; i++) - set_inode_used(irec, i); + set_inode_used(irec, 0); /* root dir */ + set_inode_used(irec, 1); /* rt bitmap or metadata dir root */ + if (!xfs_has_metadir(mp)) + set_inode_used(irec, 2); /* rt summary */ } static void