summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTang Junhui <tang.junhui@zte.com.cn>2017-09-06 06:25:53 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-09-27 12:39:24 (GMT)
commit8f51f38883dcff93f55e132d3d8b1c991e809474 (patch)
treeb272ba679381c85a78af274071a447adf358dcbc
parentc234e0e77572d78cbac0de7acee2263343595c25 (diff)
downloadlinux-8f51f38883dcff93f55e132d3d8b1c991e809474.tar.xz
bcache: do not subtract sectors_to_gc for bypassed IO
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.junhui@zte.com.cn> Acked-by: Coly Li <colyli@suse.de> Reviewed-by: Eric Wheeler <bcache@linux.ewheeler.net> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/md/bcache/request.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
index a37c177..e0f1c6d 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -196,12 +196,12 @@ 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 (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_PREFLUSH; if the original write was a
* flush, it'll wait on the journal write.