From: Darrick J. Wong Date: Mon, 22 Apr 2024 17:01:16 +0000 (-0700) Subject: xfs_scrub: update health status if we get a clean bill of health X-Git-Tag: v6.9.0~14^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3ae2c9487cf6351454b33b96f4680cd06abd7f70;p=thirdparty%2Fxfsprogs-dev.git xfs_scrub: update health status if we get a clean bill of health If we checked a filesystem and it turned out to be clean, upload that information into the kernel. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- diff --git a/libfrog/scrub.c b/libfrog/scrub.c index b6b8ae04..1df2965f 100644 --- a/libfrog/scrub.c +++ b/libfrog/scrub.c @@ -144,6 +144,11 @@ const struct xfrog_scrub_descr xfrog_scrubbers[XFS_SCRUB_TYPE_NR] = { .descr = "inode link counts", .group = XFROG_SCRUB_GROUP_ISCAN, }, + [XFS_SCRUB_TYPE_HEALTHY] = { + .name = "healthy", + .descr = "retained health records", + .group = XFROG_SCRUB_GROUP_NONE, + }, }; /* Invoke the scrub ioctl. Returns zero or negative error code. */ diff --git a/man/man2/ioctl_xfs_scrub_metadata.2 b/man/man2/ioctl_xfs_scrub_metadata.2 index 8e8bb72f..9963f191 100644 --- a/man/man2/ioctl_xfs_scrub_metadata.2 +++ b/man/man2/ioctl_xfs_scrub_metadata.2 @@ -168,6 +168,12 @@ count) for errors. .TP .B XFS_SCRUB_TYPE_NLINKS Scan all inodes in the filesystem to verify each file's link count. + +.TP +.B XFS_SCRUB_TYPE_HEALTHY +Mark everything healthy after a clean scrub run. +This clears out all the indirect health problem markers that might remain +in the system. .RE .PD 1 diff --git a/scrub/scrub.c b/scrub/scrub.c index a22633a8..436ccb0c 100644 --- a/scrub/scrub.c +++ b/scrub/scrub.c @@ -39,20 +39,15 @@ format_scrub_descr( case XFROG_SCRUB_GROUP_PERAG: return snprintf(buf, buflen, _("AG %u %s"), meta->sm_agno, _(sc->descr)); - break; case XFROG_SCRUB_GROUP_INODE: return scrub_render_ino_descr(ctx, buf, buflen, meta->sm_ino, meta->sm_gen, "%s", _(sc->descr)); - break; case XFROG_SCRUB_GROUP_FS: case XFROG_SCRUB_GROUP_SUMMARY: case XFROG_SCRUB_GROUP_ISCAN: - return snprintf(buf, buflen, _("%s"), _(sc->descr)); - break; case XFROG_SCRUB_GROUP_NONE: - assert(0); - break; + return snprintf(buf, buflen, _("%s"), _(sc->descr)); } return -1; }