Skip to content

Commit 0471f58

Browse files
Tang Junhuigregkh
authored andcommitted
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>
1 parent 093457f commit 0471f58

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/md/bcache/request.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,12 @@ static void bch_data_insert_start(struct closure *cl)
196196
struct data_insert_op *op = container_of(cl, struct data_insert_op, cl);
197197
struct bio *bio = op->bio, *n;
198198

199-
if (atomic_sub_return(bio_sectors(bio), &op->c->sectors_to_gc) < 0)
200-
wake_up_gc(op->c);
201-
202199
if (op->bypass)
203200
return bch_data_invalidate(cl);
204201

202+
if (atomic_sub_return(bio_sectors(bio), &op->c->sectors_to_gc) < 0)
203+
wake_up_gc(op->c);
204+
205205
/*
206206
* Journal writes are marked REQ_FLUSH; if the original write was a
207207
* flush, it'll wait on the journal write.

0 commit comments

Comments
 (0)