1
0
Fork 0

bcache: cached_dev_free needs to put the sb page

[ Upstream commit e8547d4209 ]

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>
5.4-rM2-2.2.x-imx-squashed
Liang Chen 2020-01-24 01:01:26 +08:00 committed by Greg Kroah-Hartman
parent 714cd4a512
commit f7d8ebf26d
1 changed files with 3 additions and 0 deletions

View File

@ -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);