Skip to content

Commit 9b54770

Browse files
author
Andreas Gruenbacher
committed
gfs2: Remove duplicate check in do_xmote
In do_xmote(), remove the duplicate check for the ->go_sync and ->go_inval glock operations. They are either both defined, or none of them are. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Reviewed-by: Andrew Price <anprice@redhat.com>
1 parent 0c23e24 commit 9b54770

1 file changed

Lines changed: 13 additions & 14 deletions

File tree

fs/gfs2/glock.c

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -714,25 +714,24 @@ __acquires(&gl->gl_lockref.lock)
714714
&gl->gl_flags))
715715
return;
716716
}
717-
if (!glops->go_inval && !glops->go_sync)
717+
if (!glops->go_inval || !glops->go_sync)
718718
goto skip_inval;
719719

720720
spin_unlock(&gl->gl_lockref.lock);
721-
if (glops->go_sync) {
722-
ret = glops->go_sync(gl);
723-
/* If we had a problem syncing (due to io errors or whatever,
724-
* we should not invalidate the metadata or tell dlm to
725-
* release the glock to other nodes.
726-
*/
727-
if (ret) {
728-
if (cmpxchg(&sdp->sd_log_error, 0, ret)) {
729-
fs_err(sdp, "Error %d syncing glock\n", ret);
730-
gfs2_dump_glock(NULL, gl, true);
731-
}
732-
spin_lock(&gl->gl_lockref.lock);
733-
goto skip_inval;
721+
ret = glops->go_sync(gl);
722+
/* If we had a problem syncing (due to io errors or whatever,
723+
* we should not invalidate the metadata or tell dlm to
724+
* release the glock to other nodes.
725+
*/
726+
if (ret) {
727+
if (cmpxchg(&sdp->sd_log_error, 0, ret)) {
728+
fs_err(sdp, "Error %d syncing glock\n", ret);
729+
gfs2_dump_glock(NULL, gl, true);
734730
}
731+
spin_lock(&gl->gl_lockref.lock);
732+
goto skip_inval;
735733
}
734+
736735
if (test_bit(GLF_INVALIDATE_IN_PROGRESS, &gl->gl_flags)) {
737736
/*
738737
* The call to go_sync should have cleared out the ail list.

0 commit comments

Comments
 (0)