From: Nicholas Swenson Date: Thu, 12 Dec 2013 20:53:28 +0000 (-0800) Subject: bcache: bugfix - gc thread now gets woken when cache is full X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e3b4825b85eab879b618af6ea18529ca7ab9a64f;p=linux-beck.git bcache: bugfix - gc thread now gets woken when cache is full Signed-off-by: Nicholas Swenson --- diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index fcdb59f9ca91..675229b93718 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c @@ -354,14 +354,14 @@ static void bch_data_insert_start(struct closure *cl) struct data_insert_op *op = container_of(cl, struct data_insert_op, cl); struct bio *bio = op->bio, *n; - if (op->bypass) - return bch_data_invalidate(cl); - if (atomic_sub_return(bio_sectors(bio), &op->c->sectors_to_gc) < 0) { set_gc_sectors(op->c); wake_up_gc(op->c); } + if (op->bypass) + return bch_data_invalidate(cl); + /* * Journal writes are marked REQ_FLUSH; if the original write was a * flush, it'll wait on the journal write.