mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 04:48:04 +09:00
gfs2: Fix error handling in init_statfs
commit5d49d3508bupstream. On an error path, init_statfs calls iput(pn) after pn has already been put. Fix that by setting pn to NULL after the initial iput. Fixes:97fd734ba1("gfs2: lookup local statfs inodes prior to journal recovery") Cc: stable@vger.kernel.org # v5.10+ Reported-by: Jing Xiangfeng <jingxiangfeng@huawei.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3ae1c663bd
commit
f794c839df
@@ -670,6 +670,7 @@ static int init_statfs(struct gfs2_sbd *sdp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
iput(pn);
|
iput(pn);
|
||||||
|
pn = NULL;
|
||||||
ip = GFS2_I(sdp->sd_sc_inode);
|
ip = GFS2_I(sdp->sd_sc_inode);
|
||||||
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0,
|
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0,
|
||||||
&sdp->sd_sc_gh);
|
&sdp->sd_sc_gh);
|
||||||
|
|||||||
Reference in New Issue
Block a user