diff options
| author | Tang Junhui <tang.junhui@zte.com.cn> | 2017-09-06 14:25:53 +0800 |
|---|---|---|
| committer | Ben Hutchings <ben@decadent.org.uk> | 2017-11-26 13:50:33 +0000 |
| commit | f1f2d73bab02e551627fea150ca3edfb1016057c (patch) | |
| tree | a45b55df100b1ae08efb3df42391396275eac061 | |
| parent | d1550aa7f5c100e6269afbf58acbcd3abfb5dcc6 (diff) | |
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>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
| -rw-r--r-- | drivers/md/bcache/request.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index 84e8e983aa51..cd41f03b91c2 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c @@ -193,14 +193,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. |
