From: NeilBrown Date: Mon, 9 Aug 2010 10:20:16 +0000 (+1000) Subject: Be more careful about waking cleaner in cluster_end_io. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=090259edceac3373d64d28d27cfd2a29991e7687;p=LaFS.git Be more careful about waking cleaner in cluster_end_io. If done was set as well as wake, we didn't wake the cleaner so *FlushNeeded wouldn't necessarily be effective. Signed-off-by: NeilBrown --- diff --git a/cluster.c b/cluster.c index da9643a..2cdc2a4 100644 --- a/cluster.c +++ b/cluster.c @@ -1430,10 +1430,9 @@ static void cluster_end_io(struct bio *bio, int err, if (atomic_read(&wc->pending_cnt[which]) == 1) wake = 1; - if (done) { + if (done) schedule_work(&fs->done_work); - wake_up(&wc->pending_wait); - } else if (wake) { + if (done || wake) { wake_up(&wc->pending_wait); if (test_bit(FlushNeeded, &fs->fsstate) || test_bit(SecondFlushNeeded, &fs->fsstate))