From patchwork Fri Dec 30 22:17:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13085064 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A441C4332F for ; Sat, 31 Dec 2022 00:10:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235575AbiLaAK1 (ORCPT ); Fri, 30 Dec 2022 19:10:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231164AbiLaAK0 (ORCPT ); Fri, 30 Dec 2022 19:10:26 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DB591CB3E for ; Fri, 30 Dec 2022 16:10:25 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4D665B81DF6 for ; Sat, 31 Dec 2022 00:10:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15A6DC433D2; Sat, 31 Dec 2022 00:10:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672445423; bh=taJLUJBF/R1wlpLJxVCvpB0hbONt2ctafOHDS51yp6k=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=YyQfl7zG+m+7NQIW0F9GDxGIdaZyBn2aHaubtqZxJ5moP5f0baU5nOed2as3TSTdR B/wBt3AHSVnQ2+T3PEAqguRbxjZr3joyVcat14IGIMNuwTPhgS0Vs2i6Q9aEOkeL3s YU+Vm/JMGEfxykhI4lqI4cIb5nMhTGOzq5Vvb4rdb9uC0t/oipW3PGa6qUxZLgH9un zrD9qiidILyuNS6d1oeHePNJkPagA18gRR1ZYKYY1vXtD9nkKBJtwdrggvjdgUtzcP 4k02N7Kwmksj6YlgLT0yBrdBxY2OfmG5xmBXkObL1e0Bq2il6Y60eZUaFYmFQ+sA3F +dt2V0oMTO+Mg== Subject: [PATCH 1/4] xfs: add secondary and indirect classes to the health tracking system From: "Darrick J. Wong" To: cem@kernel.org, djwong@kernel.org Cc: linux-xfs@vger.kernel.org Date: Fri, 30 Dec 2022 14:17:38 -0800 Message-ID: <167243865830.711359.12280366664845262118.stgit@magnolia> In-Reply-To: <167243865816.711359.1865490497957941966.stgit@magnolia> References: <167243865816.711359.1865490497957941966.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong Establish two more classes of health tracking bits: * Indirect problems, which suggest problems in other health domains that we weren't able to preserve. * Secondary problems, which track state that's related to primary evidence of health problems; and The first class we'll use in an upcoming patch to record in the AG health status the fact that we ran out of memory and had to inactivate an inode with defective metadata. The second class we use to indicate that repair knows that an inode is bad and we need to fix it later. Signed-off-by: Darrick J. Wong --- libxfs/xfs_health.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/libxfs/xfs_health.h b/libxfs/xfs_health.h index e2e1b95ddfb..b3733f756bb 100644 --- a/libxfs/xfs_health.h +++ b/libxfs/xfs_health.h @@ -31,6 +31,19 @@ * - !checked && sick => errors have been observed during normal operation, * but the metadata has not been checked thoroughly * - !checked && !sick => has not been examined since mount + * + * Evidence of health problems can be sorted into three basic categories: + * + * a) Primary evidence, which signals that something is defective within the + * general grouping of metadata. + * + * b) Secondary evidence, which are side effects of primary problem but are + * not themselves problems. These can be forgotten when the primary + * health problems are addressed. + * + * c) Indirect evidence, which points to something being wrong in another + * group, but we had to release resources and this is all that's left of + * that state. */ struct xfs_mount; @@ -105,6 +118,35 @@ struct xfs_da_args; XFS_SICK_INO_SYMLINK | \ XFS_SICK_INO_PARENT) +/* Secondary state related to (but not primary evidence of) health problems. */ +#define XFS_SICK_FS_SECONDARY (0) +#define XFS_SICK_RT_SECONDARY (0) +#define XFS_SICK_AG_SECONDARY (0) +#define XFS_SICK_INO_SECONDARY (0) + +/* 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_INO_INDIRECT (0) + +/* All health masks. */ +#define XFS_SICK_FS_ALL (XFS_SICK_FS_PRIMARY | \ + XFS_SICK_FS_SECONDARY | \ + XFS_SICK_FS_INDIRECT) + +#define XFS_SICK_RT_ALL (XFS_SICK_RT_PRIMARY | \ + XFS_SICK_RT_SECONDARY | \ + XFS_SICK_RT_INDIRECT) + +#define XFS_SICK_AG_ALL (XFS_SICK_AG_PRIMARY | \ + XFS_SICK_AG_SECONDARY | \ + XFS_SICK_AG_INDIRECT) + +#define XFS_SICK_INO_ALL (XFS_SICK_INO_PRIMARY | \ + XFS_SICK_INO_SECONDARY | \ + XFS_SICK_INO_INDIRECT) + /* * These functions must be provided by the xfs implementation. Function * behavior with respect to the first argument should be as follows: