gfs2 filesystem and dlm development
 help / color / mirror / Atom feed
* [PATCH] gfs2: free page leak on gfs2_write_log_header error path
@ 2026-11-26 23:00 Andreas Gruenbacher
  2026-11-26 23:04 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Gruenbacher @ 2026-11-26 23:00 UTC (permalink / raw)
  To: gfs2; +Cc: Andreas Gruenbacher

When gfs2_get_extent() fails, gfs2_write_log_header() needs to free the
page it has just allocated.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
 fs/gfs2/log.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index db40045ee2d0..d6876d2091c9 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -877,8 +877,10 @@ void gfs2_write_log_header(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd,
 
 		extlen = 1;
 		ret = gfs2_get_extent(jd->jd_inode, lblock, &dblock, &extlen);
-		if (gfs2_assert_withdraw(sdp, ret == 0))
+		if (gfs2_assert_withdraw(sdp, ret == 0)) {
+			mempool_free(page, gfs2_page_pool);
 			return;
+		}
 	}
 	lh->lh_addr = cpu_to_be64(dblock);
 	lh->lh_jinode = cpu_to_be64(GFS2_I(jd->jd_inode)->i_no_addr);
-- 
2.56.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-26 23:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 23:00 [PATCH] gfs2: free page leak on gfs2_write_log_header error path Andreas Gruenbacher
2026-11-26 23:04 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox