summaryrefslogtreecommitdiff
path: root/fs/dlm/dir.c
diff options
context:
space:
mode:
authorAlexander Aring <aahringo@redhat.com>2021-11-02 22:17:13 +0300
committerDavid Teigland <teigland@redhat.com>2021-11-02 22:39:20 +0300
commite10249b1902d3b0b71e99f518a695c2c39ab4fe6 (patch)
tree25b5c0d58b18c3563e32ec4f28facb9c1c566797 /fs/dlm/dir.c
parent3e9736713d0cb2877b11ec7185b231bba7b21936 (diff)
downloadlinux-e10249b1902d3b0b71e99f518a695c2c39ab4fe6.tar.xz
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: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/dir.c')
-rw-r--r--fs/dlm/dir.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/dlm/dir.c b/fs/dlm/dir.c
index 45ebbe602bbf..b6692f81ec83 100644
--- a/fs/dlm/dir.c
+++ b/fs/dlm/dir.c
@@ -84,8 +84,7 @@ int dlm_recover_directory(struct dlm_ls *ls)
for (;;) {
int left;
- error = dlm_recovery_stopped(ls);
- if (error) {
+ if (dlm_recovery_stopped(ls)) {
error = -EINTR;
goto out_free;
}