Skip to content

Commit aee742c

Browse files
Alexander Aringteigland
authored andcommitted
fs: dlm: fix return -EINTR on recovery stopped
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>
1 parent b97f852 commit aee742c

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

fs/dlm/dir.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@ int dlm_recover_directory(struct dlm_ls *ls)
8585
for (;;) {
8686
int left;
8787
error = dlm_recovery_stopped(ls);
88-
if (error)
88+
if (error) {
89+
error = -EINTR;
8990
goto out_free;
91+
}
9092

9193
error = dlm_rcom_names(ls, memb->nodeid,
9294
last_name, last_len);

fs/dlm/member.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,10 @@ static int ping_members(struct dlm_ls *ls)
443443

444444
list_for_each_entry(memb, &ls->ls_nodes, list) {
445445
error = dlm_recovery_stopped(ls);
446-
if (error)
446+
if (error) {
447+
error = -EINTR;
447448
break;
449+
}
448450
error = dlm_rcom_status(ls, memb->nodeid, 0);
449451
if (error)
450452
break;

fs/dlm/recoverd.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,10 @@ static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv)
125125
dlm_recover_waiters_pre(ls);
126126

127127
error = dlm_recovery_stopped(ls);
128-
if (error)
128+
if (error) {
129+
error = -EINTR;
129130
goto fail;
131+
}
130132

131133
if (neg || dlm_no_directory(ls)) {
132134
/*

0 commit comments

Comments
 (0)