Commit 6d37fe5c authored by Tang Junhui's avatar Tang Junhui Committed by Thadeu Lima de Souza Cascardo

bcache: do not subtract sectors_to_gc for bypassed IO

BugLink: http://bugs.launchpad.net/bugs/1721477

commit 69daf03a upstream.

Since bypassed IOs use no bucket, so do not subtract sectors_to_gc to
trigger gc thread.
Signed-off-by: default avatartang.junhui <tang.junhui@zte.com.cn>
Acked-by: default avatarColy Li <colyli@suse.de>
Reviewed-by: default avatarEric Wheeler <bcache@linux.ewheeler.net>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
parent afb77c45
...@@ -196,12 +196,12 @@ static void bch_data_insert_start(struct closure *cl) ...@@ -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 data_insert_op *op = container_of(cl, struct data_insert_op, cl);
struct bio *bio = op->bio, *n; 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) if (op->bypass)
return bch_data_invalidate(cl); 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 * Journal writes are marked REQ_FLUSH; if the original write was a
* flush, it'll wait on the journal write. * flush, it'll wait on the journal write.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment