Skip to contentSkip to conversation

gfs2: Fix error exit in do_xmote

PATCH New Bob Peterson 1 participant 1 message Apr 23, 2020 1 message not in the archive GFS2 file system

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 gfs2: Fix error exit in do_xmote

In reply to a message not in the archive

Hi,

Before this patch , if an error was detected from glock function go_sync by function do_xmote, it would return. But the function had temporarily unlocked the gl_lockref spin_lock, and it never re-locked it. When the caller of do_xmote tried to unlock it again, it was already unlocked, which resulted in a corrupted spin_lock value.

This patch changes the "return" to "goto out" so the spin_lock gets proper re-locked upon exit.

---
 fs/gfs2/glock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/gfs2/glock.c +1 -1
index 29f9b6684b74..a1c5f245553f 100644
@@ -613,7 +613,7 @@ __acquires(&gl->gl_lockref.lock)
 				fs_err(sdp, "Error %d syncing glock \n", ret);
 				gfs2_dump_glock(NULL, gl, true);
 			}
-			return;
+			goto out;
 		}
 	}
 	if (test_bit(GLF_INVALIDATE_IN_PROGRESS, &gl->gl_flags)) {