Skip to content

Commit 2cdc98a

Browse files
teiglandswhiteho
authored andcommitted
[DLM] fix stopping unstarted recovery
Red Hat BZ 211914 When many nodes are joining a lockspace simultaneously, the dlm gets a quick sequence of stop/start events, a pair for adding each node. dlm_controld in user space sends dlm_recoverd in the kernel each stop and start event. dlm_controld will sometimes send the stop before dlm_recoverd has had a chance to take up the previously queued start. The stop aborts the processing of the previous start by setting the RECOVERY_STOP flag. dlm_recoverd is erroneously clearing this flag and ignoring the stop/abort if it happens to take up the start after the stop meant to abort it. The fix is to check the sequence number that's incremented for each stop/start before clearing the flag. Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
1 parent 91c0dc9 commit 2cdc98a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎fs/dlm/recoverd.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,19 @@ static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv)
219219
return error;
220220
}
221221

222+
/* The dlm_ls_start() that created the rv we take here may already have been
223+
stopped via dlm_ls_stop(); in that case we need to leave the RECOVERY_STOP
224+
flag set. */
225+
222226
static void do_ls_recovery(struct dlm_ls *ls)
223227
{
224228
struct dlm_recover *rv = NULL;
225229

226230
spin_lock(&ls->ls_recover_lock);
227231
rv = ls->ls_recover_args;
228232
ls->ls_recover_args = NULL;
229-
clear_bit(LSFL_RECOVERY_STOP, &ls->ls_flags);
233+
if (rv && ls->ls_recover_seq == rv->seq)
234+
clear_bit(LSFL_RECOVERY_STOP, &ls->ls_flags);
230235
spin_unlock(&ls->ls_recover_lock);
231236

232237
if (rv) {

0 commit comments

Comments
 (0)