Skip to contentSkip to conversation

GFS2: Don't do glock put on when inode creation fails

PATCH New Bob Peterson 1 participant 1 message Dec 4, 2015 1 message not in the archive GFS2 file system

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 GFS2: Don't do glock put on when inode creation fails

Hi,

Currently the error path of function gfs2_inode_lookup calls function gfs2_glock_put corresponding to an earlier call to gfs2_glock_get for the inode glock. That's wrong because the error path also calls iget_failed() which eventually calls iput, which eventually calls gfs2_evict_inode, which does another gfs2_glock_put. This double-put can cause the glock reference count to get off.

Regards,

Bob Peterson
Red Hat File Systems
---

fs/gfs2/inode.c +0 -1
index 1cc6d8e..148a4d5 100644
@@ -197,7 +197,6 @@ fail_iopen:
 		gfs2_glock_put(io_gl);
 fail_put:
 	ip->i_gl->gl_object = NULL;
-	gfs2_glock_put(ip->i_gl);
 fail:
 	iget_failed(inode);
 	return ERR_PTR(error);