4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tang Junhui <tang.jun...@zte.com.cn>

commit 69daf03adef5f7bc13e0ac86b4b8007df1767aab upstream.

Since bypassed IOs use no bucket, so do not subtract sectors_to_gc to
trigger gc thread.

Signed-off-by: tang.junhui <tang.jun...@zte.com.cn>
Acked-by: Coly Li <col...@suse.de>
Reviewed-by: Eric Wheeler <bca...@linux.ewheeler.net>
Reviewed-by: Christoph Hellwig <h...@lst.de>
Signed-off-by: Jens Axboe <ax...@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

---
 drivers/md/bcache/request.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -196,12 +196,12 @@ static void bch_data_insert_start(struct
        struct data_insert_op *op = container_of(cl, struct data_insert_op, cl);
        struct bio *bio = op->bio, *n;
 
-       if (atomic_sub_return(bio_sectors(bio), &op->c->sectors_to_gc) < 0)
-               wake_up_gc(op->c);
-
        if (op->bypass)
                return bch_data_invalidate(cl);
 
+       if (atomic_sub_return(bio_sectors(bio), &op->c->sectors_to_gc) < 0)
+               wake_up_gc(op->c);
+
        /*
         * Journal writes are marked REQ_FLUSH; if the original write was a
         * flush, it'll wait on the journal write.


Reply via email to