Commit e10249b1 authored by Alexander Aring's avatar Alexander Aring Committed by David Teigland

fs: dlm: use dlm_recovery_stopped in condition

This patch will change to evaluate the dlm_recovery_stopped() in the
condition of the if branch instead fetch it before evaluating the
condition. As this is an atomic test-set operation it should be
evaluated in the condition itself.
Reported-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
parent 3e973671
...@@ -84,8 +84,7 @@ int dlm_recover_directory(struct dlm_ls *ls) ...@@ -84,8 +84,7 @@ int dlm_recover_directory(struct dlm_ls *ls)
for (;;) { for (;;) {
int left; int left;
error = dlm_recovery_stopped(ls); if (dlm_recovery_stopped(ls)) {
if (error) {
error = -EINTR; error = -EINTR;
goto out_free; goto out_free;
} }
......
...@@ -442,8 +442,7 @@ static int ping_members(struct dlm_ls *ls) ...@@ -442,8 +442,7 @@ static int ping_members(struct dlm_ls *ls)
int error = 0; int error = 0;
list_for_each_entry(memb, &ls->ls_nodes, list) { list_for_each_entry(memb, &ls->ls_nodes, list) {
error = dlm_recovery_stopped(ls); if (dlm_recovery_stopped(ls)) {
if (error) {
error = -EINTR; error = -EINTR;
break; break;
} }
......
...@@ -124,8 +124,7 @@ static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv) ...@@ -124,8 +124,7 @@ static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv)
dlm_recover_waiters_pre(ls); dlm_recover_waiters_pre(ls);
error = dlm_recovery_stopped(ls); if (dlm_recovery_stopped(ls)) {
if (error) {
error = -EINTR; error = -EINTR;
goto fail; goto fail;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment