Skip to content

Commit

Permalink
fs: dlm: fix return -EINTR on recovery stopped
Browse files Browse the repository at this point in the history
This patch will return -EINTR instead of 1 if recovery is stopped. In
case of ping_members() the return value will be checked if the error is
-EINTR for signaling another recovery was triggered and the whole
recovery process will come to a clean end to process the next one.
Returning 1 will abort the recovery process and can leave the recovery
in a broken state.

It was reported with the following kernel log message attached and a gfs2
mount stopped working:

"dlm: bobvirt1: dlm_recover_members error 1"

whereas 1 was returned because of a conversion of "dlm_recovery_stopped()"
to an errno was missing which this patch will introduce. While on it all
other possible missing errno conversions at other places were added as
they are done as in other places.

It might be worth to check the error case at this recovery level,
because some of the functionality also returns -ENOBUFS and check why
recovery ends in a broken state. However this will fix the issue if
another recovery was triggered at some points of recovery handling.

Reported-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
  • Loading branch information
Alexander Aring authored and David Teigland committed Aug 19, 2021
1 parent b97f852 commit aee742c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion fs/dlm/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ int dlm_recover_directory(struct dlm_ls *ls)
for (;;) {
int left;
error = dlm_recovery_stopped(ls);
if (error)
if (error) {
error = -EINTR;
goto out_free;
}

error = dlm_rcom_names(ls, memb->nodeid,
last_name, last_len);
Expand Down
4 changes: 3 additions & 1 deletion fs/dlm/member.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,10 @@ static int ping_members(struct dlm_ls *ls)

list_for_each_entry(memb, &ls->ls_nodes, list) {
error = dlm_recovery_stopped(ls);
if (error)
if (error) {
error = -EINTR;
break;
}
error = dlm_rcom_status(ls, memb->nodeid, 0);
if (error)
break;
Expand Down
4 changes: 3 additions & 1 deletion fs/dlm/recoverd.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv)
dlm_recover_waiters_pre(ls);

error = dlm_recovery_stopped(ls);
if (error)
if (error) {
error = -EINTR;
goto fail;
}

if (neg || dlm_no_directory(ls)) {
/*
Expand Down

0 comments on commit aee742c

Please sign in to comment.