From patchwork Tue Mar 26 03:35:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13603453 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 82A6E1D53C for ; Tue, 26 Mar 2024 03:35:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711424112; cv=none; b=gJ4cPdxbEJQ74zzzEpkr6BbcfGndG7jOVS+7wU7MlJPGiPemPpajU486DCoNlF14fjfBuHzsMzreJ43f9ifwY4GxB6ofLX6Ws/IwgtmzWNbVyFPtjVwLFdwkdx2R+LjhDplzE3ptZCpLs1ITtGgRsH8dLTYmXwG3zcrtmkmBrNE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711424112; c=relaxed/simple; bh=6avTmsJsjDbMdX8CTvSg4FffjMtBp1i8wXp6zRQzDg8=; h=Date:Subject:From:To:Cc:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ChEcxZh01kk7a7bsuiq+8D7gZFouOPR1VRdu1DHaad64ET8IOfKIqRbJIfmz8N2yO4aDcpIqQcgCdXrfR1WFOnWHm+Yhcq27JzlvA8rlbC2jG4Qut+cnQx9ifhxstzBARRWWKACevz2jo0szQRT44ei6upO1NpPBvWkA/vsCyLE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AQAj2Y35; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AQAj2Y35" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B81EC433C7; Tue, 26 Mar 2024 03:35:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711424112; bh=6avTmsJsjDbMdX8CTvSg4FffjMtBp1i8wXp6zRQzDg8=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=AQAj2Y357uFK76u1vOqshQLMQ/2GlmKGcQl/5PzucSXWMmxsHtfWjVp/PekME6mNU JvbBZDttOPecx8Ua1arH5JI1lT3T+Xva+oKBqXSAvZhqAQK2tgxzaenShiYm669QZI pWxffe4Fdli9Bbws0ruJz40ArZMpBa9cu3PVzYYGaHIjxPI+lY/YL0j6R2QiYO7zLR ilCbf30MNOeII+xX0pcDeLX21jBAQ/rdczfn/pxN+sI7FBLXdwP58VT9epJImppB2r lbQ3PcXVzk5PSoDKSESJ1nxtRYZooEVJd4QWGCyBh0M3mOI15Hg8vu3o4kM4Ks2vWM cT9I0hzoVjWvg== Date: Mon, 25 Mar 2024 20:35:11 -0700 Subject: [PATCH 026/110] xfs: remember sick inodes that get inactivated From: "Darrick J. Wong" To: cem@kernel.org, djwong@kernel.org Cc: Christoph Hellwig , linux-xfs@vger.kernel.org Message-ID: <171142131760.2215168.14198801529444681686.stgit@frogsfrogsfrogs> In-Reply-To: <171142131228.2215168.2795743548791967397.stgit@frogsfrogsfrogs> References: <171142131228.2215168.2795743548791967397.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 From: Darrick J. Wong Source kernel commit: 0e24ec3c56fbc797b34fc94073320c336336b4f9 If an unhealthy inode gets inactivated, remember this fact in the per-fs health summary. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- libxfs/xfs_fs.h | 1 + libxfs/xfs_health.h | 8 ++++++-- libxfs/xfs_inode_buf.c | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h index 515cd27d3b3a..b5c8da7e6aa9 100644 --- a/libxfs/xfs_fs.h +++ b/libxfs/xfs_fs.h @@ -294,6 +294,7 @@ struct xfs_ag_geometry { #define XFS_AG_GEOM_SICK_FINOBT (1 << 7) /* free inode index */ #define XFS_AG_GEOM_SICK_RMAPBT (1 << 8) /* reverse mappings */ #define XFS_AG_GEOM_SICK_REFCNTBT (1 << 9) /* reference counts */ +#define XFS_AG_GEOM_SICK_INODES (1 << 10) /* bad inodes were seen */ /* * Structures for XFS_IOC_FSGROWFSDATA, XFS_IOC_FSGROWFSLOG & XFS_IOC_FSGROWFSRT diff --git a/libxfs/xfs_health.h b/libxfs/xfs_health.h index 032d45fcbd51..3c64b5f9bd68 100644 --- a/libxfs/xfs_health.h +++ b/libxfs/xfs_health.h @@ -76,6 +76,7 @@ struct xfs_da_args; #define XFS_SICK_AG_FINOBT (1 << 7) /* free inode index */ #define XFS_SICK_AG_RMAPBT (1 << 8) /* reverse mappings */ #define XFS_SICK_AG_REFCNTBT (1 << 9) /* reference counts */ +#define XFS_SICK_AG_INODES (1 << 10) /* inactivated bad inodes */ /* Observable health issues for inode metadata. */ #define XFS_SICK_INO_CORE (1 << 0) /* inode core */ @@ -92,6 +93,9 @@ struct xfs_da_args; #define XFS_SICK_INO_DIR_ZAPPED (1 << 10) /* directory erased */ #define XFS_SICK_INO_SYMLINK_ZAPPED (1 << 11) /* symlink erased */ +/* Don't propagate sick status to ag health summary during inactivation */ +#define XFS_SICK_INO_FORGET (1 << 12) + /* Primary evidence of health problems in a given group. */ #define XFS_SICK_FS_PRIMARY (XFS_SICK_FS_COUNTERS | \ XFS_SICK_FS_UQUOTA | \ @@ -132,12 +136,12 @@ struct xfs_da_args; #define XFS_SICK_FS_SECONDARY (0) #define XFS_SICK_RT_SECONDARY (0) #define XFS_SICK_AG_SECONDARY (0) -#define XFS_SICK_INO_SECONDARY (0) +#define XFS_SICK_INO_SECONDARY (XFS_SICK_INO_FORGET) /* Evidence of health problems elsewhere. */ #define XFS_SICK_FS_INDIRECT (0) #define XFS_SICK_RT_INDIRECT (0) -#define XFS_SICK_AG_INDIRECT (0) +#define XFS_SICK_AG_INDIRECT (XFS_SICK_AG_INODES) #define XFS_SICK_INO_INDIRECT (0) /* All health masks. */ diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c index 83d936981166..82cf64db938c 100644 --- a/libxfs/xfs_inode_buf.c +++ b/libxfs/xfs_inode_buf.c @@ -136,7 +136,7 @@ xfs_imap_to_bp( imap->im_len, XBF_UNMAPPED, bpp, &xfs_inode_buf_ops); if (xfs_metadata_is_sick(error)) xfs_agno_mark_sick(mp, xfs_daddr_to_agno(mp, imap->im_blkno), - XFS_SICK_AG_INOBT); + XFS_SICK_AG_INODES); return error; }