diff options
author | Liang Chen <liangchen.linux@gmail.com> | 2020-01-23 20:01:26 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-02-24 10:36:56 +0300 |
commit | f7d8ebf26d239ed7f9cc4b940ff240d78c4b61d1 (patch) | |
tree | 28930a8d65f3adf69c36b377a613b6bb381ba037 /drivers/md/bcache/super.c | |
parent | 714cd4a5127a881563038f90c43cffb180990c5d (diff) | |
download | linux-f7d8ebf26d239ed7f9cc4b940ff240d78c4b61d1.tar.xz |
bcache: cached_dev_free needs to put the sb page
[ Upstream commit e8547d42095e58bee658f00fef8e33d2a185c927 ]
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>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/md/bcache/super.c')
-rw-r--r-- | drivers/md/bcache/super.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 64999c7a8033..b86cf7203340 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1274,6 +1274,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); |