Skip to content

Commit b11e1a8

Browse files
committed
gfs2: If go_sync returns error, withdraw but skip invalidate
Before this patch, if the go_sync operation returned an error during the do_xmote process (such as unable to sync metadata to the journal) the code did goto out. That kept the glock locked, so it could not be given away, which correctly avoids file system corruption. However, it never set the withdraw bit or requeueing the glock work. So it would hang forever, unable to ever demote the glock. This patch changes to goto to a new label, skip_inval, so that errors from go_sync are treated the same way as errors from go_inval: The delayed withdraw bit is set and the work is requeued. That way, the logd should eventually figure out there's a problem and withdraw properly there. Signed-off-by: Bob Peterson <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent f4e2f5e commit b11e1a8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/gfs2/glock.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ __acquires(&gl->gl_lockref.lock)
613613
fs_err(sdp, "Error %d syncing glock \n", ret);
614614
gfs2_dump_glock(NULL, gl, true);
615615
}
616-
goto out;
616+
goto skip_inval;
617617
}
618618
}
619619
if (test_bit(GLF_INVALIDATE_IN_PROGRESS, &gl->gl_flags)) {
@@ -633,6 +633,7 @@ __acquires(&gl->gl_lockref.lock)
633633
clear_bit(GLF_INVALIDATE_IN_PROGRESS, &gl->gl_flags);
634634
}
635635

636+
skip_inval:
636637
gfs2_glock_hold(gl);
637638
/*
638639
* Check for an error encountered since we called go_sync and go_inval.

0 commit comments

Comments
 (0)