]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
xfs: remember sick inodes that get inactivated
authorDarrick J. Wong <djwong@kernel.org>
Mon, 22 Apr 2024 17:00:56 +0000 (10:00 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 3 Jun 2024 18:37:36 +0000 (11:37 -0700)
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 <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
libxfs/xfs_fs.h
libxfs/xfs_health.h
libxfs/xfs_inode_buf.c

index 515cd27d3b3a845271e9c51a41b54b85bfa55c44..b5c8da7e6aa99ad5d8fb6cdd911f457ec3969a9c 100644 (file)
@@ -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
index 032d45fcbd51f86c92af1ee59631983062660fdf..3c64b5f9bd6817af320d86e6839d2933293e7dea 100644 (file)
@@ -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. */
index 83d936981166572319dc2341f8ef3b7a021f54f5..82cf64db938cf0125d7facc03a17fed0fd154fe6 100644 (file)
@@ -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;
 }