|
@@ -315,6 +315,16 @@ static void scrub_pending_trans_workers_inc(struct scrub_ctx *sctx)
|
|
|
atomic_inc(&fs_info->scrubs_running);
|
|
|
atomic_inc(&fs_info->scrubs_paused);
|
|
|
mutex_unlock(&fs_info->scrub_lock);
|
|
|
+
|
|
|
+ /*
|
|
|
+ * check if @scrubs_running=@scrubs_paused condition
|
|
|
+ * inside wait_event() is not an atomic operation.
|
|
|
+ * which means we may inc/dec @scrub_running/paused
|
|
|
+ * at any time. Let's wake up @scrub_pause_wait as
|
|
|
+ * much as we can to let commit transaction blocked less.
|
|
|
+ */
|
|
|
+ wake_up(&fs_info->scrub_pause_wait);
|
|
|
+
|
|
|
atomic_inc(&sctx->workers_pending);
|
|
|
}
|
|
|
|