Skip to contentSkip to conversation

gfs2: Fix gfs2_qa_get imbalance in gfs2_quota_hold

PATCH New Bob Peterson 1 participant 1 message May 15, 2023 GFS2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gfs2: Fix gfs2_qa_get imbalance in gfs2_quota_hold

This patch fixes a case in which function gfs2_quota_hold encounters an assert error and exits. The lack of gfs2_qa_put causes further problems when the inode is evicted and the get/put count is non-zero.

---
 fs/gfs2/quota.c | 1 +
 1 file changed, 1 insertion(+)
fs/gfs2/quota.c +1 -0
index 1ed17226d9ed..386ca770ce2e 100644
@@ -591,6 +591,7 @@ int gfs2_quota_hold(struct gfs2_inode *ip, kuid_t uid, kgid_t gid)
 	if (gfs2_assert_warn(sdp, !ip->i_qadata->qa_qd_num) ||
 	    gfs2_assert_warn(sdp, !test_bit(GIF_QD_LOCKED, &ip->i_flags))) {
 		error = -EIO;
+		gfs2_qa_put(ip);
 		goto out;
 	}
 
Signature · 1 line
2.40.1