gfs2: Fix memory leak in gfs2_make_fs_rw()
PATCH 1/1 gfs2: Fix memory leak in gfs2_make_fs_rw()
From: Qing Wang <[email protected]>
If gfs2_quota_init() success and filesystem is withdrawn, need to cleanup by gfs2_quota_cleanup() to avoid memory leak.
Reported-by [email protected]
Tested-by [email protected]
Fixes 601ef0d52e96 ("gfs2: Force withdraw to replay journals and wait for it to finish")
Signed-off-by Qing Wang <[email protected]>
--- fs/gfs2/super.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/gfs2/super.c +4 -2
@@ -147,8 +147,10 @@ int gfs2_make_fs_rw(struct gfs2_sbd *sdp) } error =gfs2_quota_init (sdp); -if (!error &&gfs2_withdrawn (sdp)) - error = -EIO ; +if (!error &&gfs2_withdrawn (sdp)) { +gfs2_quota_cleanup (sdp); +return -EIO ; + }if (!error)set_bit (SDF_JOURNAL_LIVE , &sdp->sd_flags);return error;
Signature · 1 line
2.43.0
Andreas Gruenbacher
maintainerQuoted 4 lines · Qing Wong
From: Qing Wang <[email protected]>
If
gfs2_quota_init()success and filesystem is withdrawn, need to cleanup bygfs2_quota_cleanup()to avoid memory leak.
This is already taken care of by commit da6f5bbc2e79 ("gfs2: fix memory leaks in gfs2_fill_super error path") now.
Thanks,
Andreas