]>
Commit | Line | Data |
---|---|---|
064f8983 SL |
1 | From ff10a42ac83b16222947069e544992c351a6fa1b Mon Sep 17 00:00:00 2001 |
2 | From: Andreas Gruenbacher <agruenba@redhat.com> | |
3 | Date: Mon, 19 Nov 2018 17:24:36 +0100 | |
4 | Subject: gfs2: Put bitmap buffers in put_super | |
5 | ||
6 | commit 10283ea525d30f2e99828978fd04d8427876a7ad upstream. | |
7 | ||
8 | gfs2_put_super calls gfs2_clear_rgrpd to destroy the gfs2_rgrpd objects | |
9 | attached to the resource group glocks. That function should release the | |
10 | buffers attached to the gfs2_bitmap objects (bi_bh), but the call to | |
11 | gfs2_rgrp_brelse for doing that is missing. | |
12 | ||
13 | When gfs2_releasepage later runs across these buffers which are still | |
14 | referenced, it refuses to free them. This causes the pages the buffers | |
15 | are attached to to remain referenced as well. With enough mount/unmount | |
16 | cycles, the system will eventually run out of memory. | |
17 | ||
18 | Fix this by adding the missing call to gfs2_rgrp_brelse in | |
19 | gfs2_clear_rgrpd. | |
20 | ||
21 | (Also fix a gfs2_rgrp_relse -> gfs2_rgrp_brelse typo in a comment.) | |
22 | ||
23 | Fixes: 39b0f1e92908 ("GFS2: Don't brelse rgrp buffer_heads every allocation") | |
24 | Cc: stable@vger.kernel.org # v4.4 | |
25 | Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> | |
26 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
27 | --- | |
28 | fs/gfs2/rgrp.c | 3 ++- | |
29 | 1 file changed, 2 insertions(+), 1 deletion(-) | |
30 | ||
31 | diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c | |
32 | index 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 | -- | |
53 | 2.17.1 | |
54 |