* [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
* Re: [PATCH] gfs2: free page leak on gfs2_write_log_header error path
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
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-26 23:04 UTC (permalink / raw)
To: Andreas Gruenbacher, gfs2
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] gfs2: missing Fixes: trailer for page leak in
gfs2_write_log_header()
--
commit daec8ff403c20a1a32badf6f30c628a4eef91de4
Author: Andreas Gruenbacher <agruenba@redhat.com>
> gfs2: free page leak on gfs2_write_log_header error path
>
> 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>
[Severity: Low]
This fixes a page leak on the early return in gfs2_write_log_header()
introduced by 7c70b896951c ("gfs2: clean_journal improperly set
sd_log_flush_head"). Should this include a Fixes: tag?
Fixes: 7c70b896951c ("gfs2: clean_journal improperly set sd_log_flush_head")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261126230030.3056456-1-agruenba@redhat.com?part=1
^ permalink raw reply [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