If we encounter a zero-length read of an xfs device but don't hit any
actual media errors, we won't report the truncated device. Fix that.
Also fix the mistake that flushing the verify-pools of the log/rt
devices doesn't actually cause scrub to abort.
Cc: <linux-xfs@vger.kernel.org> # v6.13.0
Fixes: a6e089903f2f58 ("xfs_scrub: tread zero-length read verify as an IO error")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
* If the verify flush didn't work or we found no bad blocks, we're
* done! No errors detected.
*/
- if (ret || ret2 || ret3)
+ if (ret || ret2 || ret3) {
+ ret |= ret2 | ret3; /* caller only cares about non-zero/zero */
goto out_rbad;
- if (bitmap_empty(vs.d_bad) && bitmap_empty(vs.r_bad))
+ }
+ if (bitmap_empty(vs.d_bad) && !vs.d_trunc &&
+ bitmap_empty(vs.r_bad) && !vs.r_trunc &&
+ !vs.l_trunc)
goto out_rbad;
/* Scan the whole dir tree to see what matches the bad extents. */