summaryrefslogtreecommitdiffstats
path: root/fs/xfs/scrub
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2024-02-22 12:33:03 -0800
committerDarrick J. Wong <djwong@kernel.org>2024-02-22 12:33:03 -0800
commit0e24ec3c56fbc797b34fc94073320c336336b4f9 (patch)
treef9b4bddb5fbe33bf695a69a95ca63fd6c3fbfd8b /fs/xfs/scrub
parent4e587917ee1cc28ac3a04cd55937419b9e65d81d (diff)
downloadlinux-stable-0e24ec3c56fbc797b34fc94073320c336336b4f9.tar.gz
linux-stable-0e24ec3c56fbc797b34fc94073320c336336b4f9.tar.bz2
linux-stable-0e24ec3c56fbc797b34fc94073320c336336b4f9.zip
xfs: remember sick inodes that get inactivated
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>
Diffstat (limited to 'fs/xfs/scrub')
-rw-r--r--fs/xfs/scrub/health.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/fs/xfs/scrub/health.c b/fs/xfs/scrub/health.c
index c682c7093353..af192b41e78c 100644
--- a/fs/xfs/scrub/health.c
+++ b/fs/xfs/scrub/health.c
@@ -183,9 +183,19 @@ xchk_update_health(
case XHG_INO:
if (!sc->ip)
return;
- if (bad)
- xfs_inode_mark_corrupt(sc->ip, sc->sick_mask);
- else
+ if (bad) {
+ unsigned int mask = sc->sick_mask;
+
+ /*
+ * If we're coming in for repairs then we don't want
+ * sickness flags to propagate to the incore health
+ * status if the inode gets inactivated before we can
+ * fix it.
+ */
+ if (sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR)
+ mask |= XFS_SICK_INO_FORGET;
+ xfs_inode_mark_corrupt(sc->ip, mask);
+ } else
xfs_inode_mark_healthy(sc->ip, sc->sick_mask);
break;
case XHG_FS: