All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: colyli@suse.de
Cc: kent.overstreet@gmail.com, liangchen.linux@gmail.com,
	linux-bcache@vger.kernel.org, linux-block@vger.kernel.org
Subject: [PATCH 1/7] bcache: cached_dev_free needs to put the sb page
Date: Mon,  9 Dec 2019 10:38:23 +0100	[thread overview]
Message-ID: <20191209093829.19703-2-hch@lst.de> (raw)
In-Reply-To: <20191209093829.19703-1-hch@lst.de>

From: Liang Chen <liangchen.linux@gmail.com>

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 <liangchen.linux@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 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.20.1


  reply	other threads:[~2019-12-09  9:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-09  9:38 bcache kbuild cleanups Christoph Hellwig
2019-12-09  9:38 ` Christoph Hellwig [this message]
2019-12-09  9:38 ` [PATCH 2/7] bcache: use a separate data structure for the on-disk super block Christoph Hellwig
2019-12-09  9:38 ` [PATCH 3/7] bcache: rework error unwinding in register_bcache Christoph Hellwig
2019-12-09  9:38 ` [PATCH 4/7] bcache: transfer the sb_page reference to register_{bdev,cache} Christoph Hellwig
2019-12-09  9:38 ` [PATCH 5/7] bcache: return a pointer to the on-disk sb from read_super Christoph Hellwig
2019-12-09  9:38 ` [PATCH 6/7] bcache: store a pointer to the on-disk sb in the cache and cached_dev structures Christoph Hellwig
2019-12-09  9:38 ` [PATCH 7/7] bcache: use read_cache_page_gfp to read the superblock Christoph Hellwig
2019-12-09  9:59 ` bcache kbuild cleanups Coly Li
2019-12-11 15:17   ` Liang C
2019-12-12 15:34     ` Christoph Hellwig
2019-12-12 15:35 bcache superblock reading / writing v2 Christoph Hellwig
2019-12-12 15:35 ` [PATCH 1/7] bcache: cached_dev_free needs to put the sb page Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191209093829.19703-2-hch@lst.de \
    --to=hch@lst.de \
    --cc=colyli@suse.de \
    --cc=kent.overstreet@gmail.com \
    --cc=liangchen.linux@gmail.com \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.