Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1312069ybl; Fri, 6 Dec 2019 15:10:03 -0800 (PST) X-Google-Smtp-Source: APXvYqxhvUMZUAkHELKQYO1NcpJNDX6RHZUka/6cIZZ1xB1tqvXT/MZcPy5ct1980Olfev6RCv7w X-Received: by 2002:aca:bbc6:: with SMTP id l189mr8406179oif.53.1575673803500; Fri, 06 Dec 2019 15:10:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575673803; cv=none; d=google.com; s=arc-20160816; b=WtQHr4wGrO7d7Sm+W5LwFA6+vTmCjQ7Cfn7Dinx6uSkUUO06zjERfIZ8TBTI5iKpNC vrypWBN9YXDT/WyyeU+XNnjeBCoLGaEie90W2h7gIUvUVUxhQM9OzvfC0kq/P9HzCz4y chzGVFnGX9+iW4w8051mh2R1dPbVHY34vwB7hA79jlFYnwxpAP6Kl/YmJlNkgtnbXAGG oJP9MwF8AbtqbmvvfXkTO+8r7pM67/1GSk0bbBDGaNzslO4560tppmAmYArJ5lqXnovV vhd7YvMbZY0Be3E1DQD7x+qkmN4ArC6369kqUDQSFSwhxnn/8JWoZh4GbK3a7Cl8YZgn XCAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=jzx1dQ2KO8raRhcfc9PTj5Oj5AtZTkadt9jatbfa2rQ=; b=dg3eYQh4BY8wl/HdFypi+hVIM/qXJ4ncwLF4kdCblbPkeDe8SbzOqs4/Eysp7v1G1m Rj+z9n2tuPaLyCWo4EGLLd6tVXWYA/v2wnUvZYjcpWRMWTdZKYyPc6oLyFSy1ZVgL9CS 5X6WEJeMwXpDi7RcwTcle0iW8Thcrd2/uzyHQbQ+n3krcH1C6I3goxsbl2PMsajt+dkg 69c9Fyoncfx30vq5F7k2OK2ys0oU5KqNc72HEn/t+u4x8KdckMyhBi8pDyxUFJbzPBW1 9xX6EOKNTof8mJkQ3Wqi0sfVfWgl41NGsKfdYj5VDDHEOF7OWVlBHIXIRYRwpTG7WHTX pJgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3si8446603otq.321.2019.12.06.15.09.51; Fri, 06 Dec 2019 15:10:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726395AbfLFXJY (ORCPT + 99 others); Fri, 6 Dec 2019 18:09:24 -0500 Received: from mx.ewheeler.net ([173.205.220.69]:33644 "EHLO mx.ewheeler.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726353AbfLFXJX (ORCPT ); Fri, 6 Dec 2019 18:09:23 -0500 Received: from localhost (localhost [127.0.0.1]) by mx.ewheeler.net (Postfix) with ESMTP id DB9D4A0440; Fri, 6 Dec 2019 23:09:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at ewheeler.net Received: from mx.ewheeler.net ([127.0.0.1]) by localhost (mx.ewheeler.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id H_XoFx0OiXyB; Fri, 6 Dec 2019 23:08:57 +0000 (UTC) Received: from mx.ewheeler.net (mx.ewheeler.net [173.205.220.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx.ewheeler.net (Postfix) with ESMTPSA id D5337A0633; Fri, 6 Dec 2019 23:08:56 +0000 (UTC) Date: Fri, 6 Dec 2019 23:08:55 +0000 (UTC) From: Eric Wheeler X-X-Sender: lists@mx.ewheeler.net To: Liang Chen cc: colyli@suse.de, kent.overstreet@gmail.com, linux-kernel@vger.kernel.org, linux-bcache@vger.kernel.org Subject: Re: [PATCH 1/2] [PATCH] bcache: cached_dev_free needs to put the sb page In-Reply-To: <1575622543-22470-1-git-send-email-liangchen.linux@gmail.com> Message-ID: References: <1575622543-22470-1-git-send-email-liangchen.linux@gmail.com> User-Agent: Alpine 2.11 (LRH 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 6 Dec 2019, Liang Chen wrote: > Same as cache device, the buffer page needs to be put while > freeing cached_dev. Otherwise a page would be leaked every > time a cached_dev is stopped. > > Signed-off-by: Liang Chen +cc stable? -- Eric Wheeler > --- > drivers/md/bcache/super.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c > index 77e9869345e7..a573ce1d85aa 100644 > --- a/drivers/md/bcache/super.c > +++ b/drivers/md/bcache/super.c > @@ -1275,6 +1275,9 @@ static void cached_dev_free(struct closure *cl) > > mutex_unlock(&bch_register_lock); > > + if (dc->sb_bio.bi_inline_vecs[0].bv_page) > + put_page(bio_first_page_all(&dc->sb_bio)); > + > if (!IS_ERR_OR_NULL(dc->bdev)) > blkdev_put(dc->bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL); > > -- > 2.17.0 > >