From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4504BA22 for ; Sun, 31 Dec 2023 21:13:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dCKuUwL9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74EBAC433C7; Sun, 31 Dec 2023 21:13:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704057196; bh=uje8zzS4TscI0Uz3K++y7IaffDT6CZ/feYhohcpBn2k=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=dCKuUwL9mwVu0LdPohA2nu8a6kXfwqwMVk+nYgGBB856491xmvzAtWp1H2cVRSqia W0clZ4y4JHKaz5bSy90wPsVnDqJ1HZecxchKezBcf1hQqKOTId8+JWRbIeDqRy6chW c15PqSeXxEIo+3ks2t38cIGsTQ6mJ0YG9UZqjakIHMktZokKfkqvvQ4PWYIJijKP0x 126yJETbBn9flaP3sZ2yb85foG1zrhXpXMUhypxNmt/AmFmysDNZ190yh/WENbVefQ OXxdqEYlbc0PokEQzG0xd5uRVDj9IPThPbl17PTQYasM125bkIFpnP8cF3rsWl8eJ5 c4t9b671JOdAQ== Date: Sun, 31 Dec 2023 13:13:15 -0800 Subject: [PATCH 27/32] xfs: don't check secondary super inode pointers when metadir enabled From: "Darrick J. Wong" To: djwong@kernel.org Cc: linux-xfs@vger.kernel.org Message-ID: <170404845300.1760491.9567368667780092598.stgit@frogsfrogsfrogs> In-Reply-To: <170404844790.1760491.7084433932242910678.stgit@frogsfrogsfrogs> References: <170404844790.1760491.7084433932242910678.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit From: Darrick J. Wong When metadata directories are enabled, the rt and quota inodes are no longer pointed to by the superblock, so it doesn't make sense to check these. Signed-off-by: Darrick J. Wong --- fs/xfs/scrub/agheader.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/fs/xfs/scrub/agheader.c b/fs/xfs/scrub/agheader.c index 7fd89889d1d81..b98d014f65521 100644 --- a/fs/xfs/scrub/agheader.c +++ b/fs/xfs/scrub/agheader.c @@ -144,11 +144,16 @@ xchk_superblock( if (sb->sb_rootino != cpu_to_be64(mp->m_sb.sb_rootino)) xchk_block_set_preen(sc, bp); - if (sb->sb_rbmino != cpu_to_be64(mp->m_sb.sb_rbmino)) - xchk_block_set_preen(sc, bp); + if (xfs_has_metadir(sc->mp)) { + if (sb->sb_rbmino != cpu_to_be64(mp->m_sb.sb_metadirino)) + xchk_block_set_preen(sc, bp); + } else { + if (sb->sb_rbmino != cpu_to_be64(mp->m_sb.sb_rbmino)) + xchk_block_set_preen(sc, bp); - if (sb->sb_rsumino != cpu_to_be64(mp->m_sb.sb_rsumino)) - xchk_block_set_preen(sc, bp); + if (sb->sb_rsumino != cpu_to_be64(mp->m_sb.sb_rsumino)) + xchk_block_set_preen(sc, bp); + } if (sb->sb_rextsize != cpu_to_be32(mp->m_sb.sb_rextsize)) xchk_block_set_corrupt(sc, bp); @@ -225,11 +230,13 @@ xchk_superblock( * sb_icount, sb_ifree, sb_fdblocks, sb_frexents */ - if (sb->sb_uquotino != cpu_to_be64(mp->m_sb.sb_uquotino)) - xchk_block_set_preen(sc, bp); + if (!xfs_has_metadir(sc->mp)) { + if (sb->sb_uquotino != cpu_to_be64(mp->m_sb.sb_uquotino)) + xchk_block_set_preen(sc, bp); - if (sb->sb_gquotino != cpu_to_be64(mp->m_sb.sb_gquotino)) - xchk_block_set_preen(sc, bp); + if (sb->sb_gquotino != cpu_to_be64(mp->m_sb.sb_gquotino)) + xchk_block_set_preen(sc, bp); + } /* * Skip the quota flags since repair will force quotacheck. @@ -338,8 +345,10 @@ xchk_superblock( if (sb->sb_spino_align != cpu_to_be32(mp->m_sb.sb_spino_align)) xchk_block_set_corrupt(sc, bp); - if (sb->sb_pquotino != cpu_to_be64(mp->m_sb.sb_pquotino)) - xchk_block_set_preen(sc, bp); + if (!xfs_has_metadir(sc->mp)) { + if (sb->sb_pquotino != cpu_to_be64(mp->m_sb.sb_pquotino)) + xchk_block_set_preen(sc, bp); + } /* Don't care about sb_lsn */ }