bcache: bugfix - gc thread now gets woken when cache is full
authorNicholas Swenson <nks@daterainc.com>
Thu, 12 Dec 2013 20:53:28 +0000 (12:53 -0800)
committerKent Overstreet <kmo@daterainc.com>
Wed, 29 Jan 2014 21:06:42 +0000 (13:06 -0800)
Signed-off-by: Nicholas Swenson <nks@daterainc.com>
drivers/md/bcache/request.c

index fcdb59f9ca919a8a1baaa3c3ee3d9c79738eaa23..675229b93718c9a16df5cae58cf8fb85a3aadbb8 100644 (file)
@@ -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.