From: Kent Overstreet Date: Tue, 24 Sep 2013 06:17:27 +0000 (-0700) Subject: bcache: Fix a dumb journal discard bug X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0a22f485eee6ae8da77c3e37c8856e025678cdb0;p=karo-tx-linux.git bcache: Fix a dumb journal discard bug commit 6d9d21e35fbfa2934339e96934f862d118abac23 upstream. That switch statement was obviously wrong, leading to some sort of weird spinning on rare occasion with discards enabled... Signed-off-by: Kent Overstreet Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c index b49abb246bb6..fb1bfafa21e4 100644 --- a/drivers/md/bcache/journal.c +++ b/drivers/md/bcache/journal.c @@ -425,7 +425,7 @@ static void do_journal_discard(struct cache *ca) return; } - switch (atomic_read(&ja->discard_in_flight) == DISCARD_IN_FLIGHT) { + switch (atomic_read(&ja->discard_in_flight)) { case DISCARD_IN_FLIGHT: return;