Skip to contentSkip to conversation

gfs2: When gfs2_dirty_inode gets a glock error, dump the glock

PATCH New Bob Peterson 1 participant 1 message Jul 30, 2020 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: When gfs2_dirty_inode gets a glock error, dump the glock

Hi,

Before this patch, if function gfs2_dirty_inode got an error when trying to lock the inode glock, it complained, but it didn't say what glock or inode had the problem.

In this case, it almost always means that dinode_in found an error with the dinode in the file system. So it makes sense to dump the glock, which tells us the location of the dinode in the file system. That will allow us to analyze the corruption from the metadata.

---
 fs/gfs2/super.c | 1 +
 1 file changed, 1 insertion(+)
fs/gfs2/super.c +1 -0
index 47d0ae158b69..9f4d9e7be839 100644
@@ -566,6 +566,7 @@ static void gfs2_dirty_inode(struct inode *inode, int flags)
 		ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
 		if (ret) {
 			fs_err(sdp, "dirty_inode: glock %d\n", ret);
+			gfs2_dump_glock(NULL, ip->i_gl, true);
 			return;
 		}
 		need_unlock = 1;