@@ -514,16 +514,16 @@ _("Could not create data device media verifier."));
out_rtpool:
if (vs.rvp_realtime) {
- read_verify_pool_flush(vs.rvp_realtime);
+ read_verify_pool_abort(vs.rvp_realtime);
read_verify_pool_destroy(vs.rvp_realtime);
}
out_logpool:
if (vs.rvp_log) {
- read_verify_pool_flush(vs.rvp_log);
+ read_verify_pool_abort(vs.rvp_log);
read_verify_pool_destroy(vs.rvp_log);
}
out_datapool:
- read_verify_pool_flush(vs.rvp_data);
+ read_verify_pool_abort(vs.rvp_data);
read_verify_pool_destroy(vs.rvp_data);
out_rbad:
bitmap_free(&vs.r_bad);
@@ -117,6 +117,16 @@ read_verify_pool_init(
return NULL;
}
+/* Abort all verification work. */
+void
+read_verify_pool_abort(
+ struct read_verify_pool *rvp)
+{
+ if (!rvp->errors_seen)
+ rvp->errors_seen = ECANCELED;
+ workqueue_terminate(&rvp->wq);
+}
+
/* Finish up any read verification work. */
void
read_verify_pool_flush(
@@ -19,6 +19,7 @@ struct read_verify_pool *read_verify_pool_init(struct scrub_ctx *ctx,
struct disk *disk, size_t miniosz,
read_verify_ioerr_fn_t ioerr_fn,
unsigned int submitter_threads);
+void read_verify_pool_abort(struct read_verify_pool *rvp);
void read_verify_pool_flush(struct read_verify_pool *rvp);
void read_verify_pool_destroy(struct read_verify_pool *rvp);