]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.165/gfs2-put-bitmap-buffers-in-put_super.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.4.165 / gfs2-put-bitmap-buffers-in-put_super.patch
CommitLineData
064f8983
SL
1From ff10a42ac83b16222947069e544992c351a6fa1b Mon Sep 17 00:00:00 2001
2From: Andreas Gruenbacher <agruenba@redhat.com>
3Date: Mon, 19 Nov 2018 17:24:36 +0100
4Subject: gfs2: Put bitmap buffers in put_super
5
6commit 10283ea525d30f2e99828978fd04d8427876a7ad upstream.
7
8gfs2_put_super calls gfs2_clear_rgrpd to destroy the gfs2_rgrpd objects
9attached to the resource group glocks. That function should release the
10buffers attached to the gfs2_bitmap objects (bi_bh), but the call to
11gfs2_rgrp_brelse for doing that is missing.
12
13When gfs2_releasepage later runs across these buffers which are still
14referenced, it refuses to free them. This causes the pages the buffers
15are attached to to remain referenced as well. With enough mount/unmount
16cycles, the system will eventually run out of memory.
17
18Fix this by adding the missing call to gfs2_rgrp_brelse in
19gfs2_clear_rgrpd.
20
21(Also fix a gfs2_rgrp_relse -> gfs2_rgrp_brelse typo in a comment.)
22
23Fixes: 39b0f1e92908 ("GFS2: Don't brelse rgrp buffer_heads every allocation")
24Cc: stable@vger.kernel.org # v4.4
25Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
26Signed-off-by: Sasha Levin <sashal@kernel.org>
27---
28 fs/gfs2/rgrp.c | 3 ++-
29 1 file changed, 2 insertions(+), 1 deletion(-)
30
31diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
32index c134c0462cee..ef24894edecc 100644
33--- a/fs/gfs2/rgrp.c
34+++ b/fs/gfs2/rgrp.c
35@@ -732,6 +732,7 @@ void gfs2_clear_rgrpd(struct gfs2_sbd *sdp)
36 spin_lock(&gl->gl_lockref.lock);
37 gl->gl_object = NULL;
38 spin_unlock(&gl->gl_lockref.lock);
39+ gfs2_rgrp_brelse(rgd);
40 gfs2_glock_add_to_lru(gl);
41 gfs2_glock_put(gl);
42 }
43@@ -1139,7 +1140,7 @@ static u32 count_unlinked(struct gfs2_rgrpd *rgd)
44 * @rgd: the struct gfs2_rgrpd describing the RG to read in
45 *
46 * Read in all of a Resource Group's header and bitmap blocks.
47- * Caller must eventually call gfs2_rgrp_relse() to free the bitmaps.
48+ * Caller must eventually call gfs2_rgrp_brelse() to free the bitmaps.
49 *
50 * Returns: errno
51 */
52--
532.17.1
54