diff options
author | Liang Chen <liangchen.linux@gmail.com> | 2020-01-24 01:01:26 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-01-23 11:40:00 -0700 |
commit | e8547d42095e58bee658f00fef8e33d2a185c927 (patch) | |
tree | 0d99f0fea277b4847ee8982a2909627a5af0a02d /drivers/md/bcache | |
parent | 7454049eb7e426a3bc9cc7b3fd5857c2d6ceeaee (diff) | |
download | linux-e8547d42095e58bee658f00fef8e33d2a185c927.tar.bz2 |
bcache: cached_dev_free needs to put the sb page
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>
Diffstat (limited to 'drivers/md/bcache')
-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 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); |