Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp522370ybl; Fri, 6 Dec 2019 01:43:40 -0800 (PST) X-Google-Smtp-Source: APXvYqwLuGrhbVpv1eNxFIABWlqAhctEJJ6vA96kbTsTsA7khKlYgkVfzQ/KQ0ReJ8xolrLrOh1f X-Received: by 2002:a05:6808:b26:: with SMTP id t6mr10668045oij.123.1575625420340; Fri, 06 Dec 2019 01:43:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575625420; cv=none; d=google.com; s=arc-20160816; b=wXOyNhnSxJaiXOSwIqr1R2p7mLRGp4Gw2hXmGmYdfLRDazh2FD3BDY8QgJptu2z646 /Fd/Mbdb9vlPgcT5vDnCGQb0uKvo13J6xVYgeA6gOFKXJ1UmTuj1r2jOdYGMQJyTfkvv yDsR8BaKnMgmGdZf6xbiSK4+ycY9utySWto3segE2rQn70hpFAMoUhxKsVxsNC5++Icq oU/ti5YHwSU/ArFMAEQ+jz90u0Bqtmuvmnw9kf8unNBOdLsU3IZgwzZXOsTUUrEYHsX8 kMPAhsCzui2cM7klTCLerLT+Ot8jbsGJMW7crqpAAyXLkhmIY04SfjySlkZkBKd93jZb KN1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=N1LLYyR1N7GCEvNUA1+ByQ4NrHWyI3SbYhW65jdNFyM=; b=YYkINzFwqPahs66u7s3rCNZdXmwwrIw5XRGGXkU+UTGzX2CCsXD2TUgzMtHhffojaQ jNU2t2QoYEK/5AFZAR85dSj+rhGfpcYSNgusEd+33FVMNXOBeYbQL4oRi6GxIQr9ML3s jNjB1H46NmgEKTJw0mJ2WMJPZUELduXYQkWkYsQHV8jR+mw+NogxqCbGnzPuvEnJeb/b dJwsCf6c6d5K24+vnPFPJzVmcmdaDAfObUT9hfXPbYgKtHjipp1O0SN7NOnoohuQfHC4 FQAA0zMmc3EE8E1wNWfRv1LV8HFDeYFb8mFic16kGXegsGbTiXmE68NxP1jGPZKK1idQ pROw== 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 i13si6716125oth.175.2019.12.06.01.43.27; Fri, 06 Dec 2019 01:43:40 -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 S1726214AbfLFJmz (ORCPT + 99 others); Fri, 6 Dec 2019 04:42:55 -0500 Received: from mx2.suse.de ([195.135.220.15]:47994 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726070AbfLFJmz (ORCPT ); Fri, 6 Dec 2019 04:42:55 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 5C7E9B34D; Fri, 6 Dec 2019 09:42:53 +0000 (UTC) Subject: Re: [PATCH 1/2] [PATCH] bcache: cached_dev_free needs to put the sb page To: Liang Chen Cc: kent.overstreet@gmail.com, linux-kernel@vger.kernel.org, linux-bcache@vger.kernel.org References: <1575622543-22470-1-git-send-email-liangchen.linux@gmail.com> From: Coly Li Organization: SUSE Labs Message-ID: Date: Fri, 6 Dec 2019 17:42:39 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <1575622543-22470-1-git-send-email-liangchen.linux@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/12/6 4:55 下午, 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 I have this in my for-test directory, thanks. > --- > 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); > > -- Coly Li