Return-Path: Received: from mail-by2nam01on0108.outbound.protection.outlook.com ([104.47.34.108]:2271 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754974AbeARVCL (ORCPT ); Thu, 18 Jan 2018 16:02:11 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Tang Junhui , Jens Axboe , "Sasha Levin" Subject: [added to the 4.1 stable tree] bcache: do not subtract sectors_to_gc for bypassed IO Date: Thu, 18 Jan 2018 21:00:21 +0000 Message-ID: <20180118205908.3220-108-alexander.levin@microsoft.com> References: <20180118205908.3220-1-alexander.levin@microsoft.com> In-Reply-To: <20180118205908.3220-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Tang Junhui This patch has been added to the stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit 69daf03adef5f7bc13e0ac86b4b8007df1767aab ] Since bypassed IOs use no bucket, so do not subtract sectors_to_gc to trigger gc thread. Signed-off-by: tang.junhui Acked-by: Coly Li Reviewed-by: Eric Wheeler Reviewed-by: Christoph Hellwig Cc: stable@vger.kernel.org Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/md/bcache/request.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index a9864ef73ec6..5be152b5bb59 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c @@ -193,12 +193,12 @@ static void bch_data_insert_start(struct closure *cl) struct data_insert_op *op =3D container_of(cl, struct data_insert_op, cl)= ; struct bio *bio =3D op->bio, *n; =20 - 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); =20 + 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. --=20 2.11.0