diff mbox series

[04/11] xfs_scrub: fix queue-and-stash of non-contiguous verify requests

Message ID 156944732174.298887.12947727388057082476.stgit@magnolia (mailing list archive)
State Accepted
Headers show
Series xfs_scrub: fix IO error detection during media verify | expand

Commit Message

Darrick J. Wong Sept. 25, 2019, 9:35 p.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

read_verify_schedule_io is supposed to have the ability to decide that a
retained aggregate extent verification request is not sufficiently
contiguous with the request that is being scheduled, and therefore it
needs to queue the retained request and use the new request to start
building a new aggregate request.

Unfortunately, it stupidly returns after queueing the IO, so we lose the
incoming request.  Fix the code so we only do that if there's a run time

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
 scrub/read_verify.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff mbox series


diff --git a/scrub/read_verify.c b/scrub/read_verify.c
index 8f80dcaf..980b92b8 100644
--- a/scrub/read_verify.c
+++ b/scrub/read_verify.c
@@ -265,8 +265,13 @@  read_verify_schedule_io(
 		rv->io_length = max(req_end, rv_end) - rv->io_start;
 	} else  {
 		/* Otherwise, issue the stashed IO (if there is one) */
-		if (rv->io_length > 0)
-			return read_verify_queue(rvp, rv);
+		if (rv->io_length > 0) {
+			int	res;
+			res = read_verify_queue(rvp, rv);
+			if (res)
+				return res;
+		}
 		/* Stash the new IO. */
 		rv->io_start = start;