diff mbox series

[3/7] xfs: bail out of scrub immediately if scan incomplete

Message ID 161472413358.3421582.1775111400550224556.stgit@magnolia (mailing list archive)
State Accepted
Headers show
Series xfs: small fixes and cleanups | expand

Commit Message

Darrick J. Wong March 2, 2021, 10:28 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

If a scrubber cannot complete its check and signals an incomplete check,
we must bail out immediately without updating health status, trying a
repair, etc. because our scan is incomplete and we therefore do not know
much more.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 fs/xfs/scrub/scrub.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christoph Hellwig March 5, 2021, 8:25 a.m. UTC | #1
On Tue, Mar 02, 2021 at 02:28:53PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> If a scrubber cannot complete its check and signals an incomplete check,
> we must bail out immediately without updating health status, trying a
> repair, etc. because our scan is incomplete and we therefore do not know
> much more.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c
index 8ebf35b115ce..47c68c72bcac 100644
--- a/fs/xfs/scrub/scrub.c
+++ b/fs/xfs/scrub/scrub.c
@@ -517,7 +517,7 @@  xfs_scrub_metadata(
 			goto out;
 		sc.flags |= XCHK_TRY_HARDER;
 		goto retry_op;
-	} else if (error)
+	} else if (error || (sm->sm_flags & XFS_SCRUB_OFLAG_INCOMPLETE))
 		goto out_teardown;
 
 	xchk_update_health(&sc);