]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
gfs2: Put bitmap buffers in put_super
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 5 Nov 2018 22:57:24 +0000 (22:57 +0000)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:59:21 +0000 (19:59 -0600)
commite1914d8c828b7464a8ffbb294ab2ee89a07ccbc3
treee1f3a7cfa21e017338c6a374e646f997098ed8ce
parent69a7bed7c07a29a7f47e469d62bcf4dbfe39fcb8
gfs2: Put bitmap buffers in put_super

BugLink: https://bugs.launchpad.net/bugs/1836802
commit 10283ea525d30f2e99828978fd04d8427876a7ad upstream.

gfs2_put_super calls gfs2_clear_rgrpd to destroy the gfs2_rgrpd objects
attached to the resource group glocks.  That function should release the
buffers attached to the gfs2_bitmap objects (bi_bh), but the call to
gfs2_rgrp_brelse for doing that is missing.

When gfs2_releasepage later runs across these buffers which are still
referenced, it refuses to free them.  This causes the pages the buffers
are attached to to remain referenced as well.  With enough mount/unmount
cycles, the system will eventually run out of memory.

Fix this by adding the missing call to gfs2_rgrp_brelse in
gfs2_clear_rgrpd.

(Also fix a gfs2_rgrp_relse -> gfs2_rgrp_brelse typo in a comment.)

Fixes: 39b0f1e92908 ("GFS2: Don't brelse rgrp buffer_heads every allocation")
Cc: stable@vger.kernel.org # v4.2+
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/gfs2/rgrp.c