Skip to content

Commit f6f7418

Browse files
Alexander Aringteigland
authored andcommitted
dlm: fix wake_up() calls for pending remove
This patch move the wake_up() call at the point when a remove message completed. Before it was only when a remove message was going to be sent. The possible waiter in wait_pending_remove() waits until a remove is done if the resource name matches with the per ls variable ls->ls_remove_name. If this is the case we must wait until a pending remove is done which is indicated if DLM_WAIT_PENDING_COND() returns false which will always be the case when ls_remove_len and ls_remove_name are unset to indicate that a remove is not going on anymore. Fixes: 21d9ac1 ("fs: dlm: use event based wait for pending remove") Cc: [email protected] Signed-off-by: Alexander Aring <[email protected]> Signed-off-by: David Teigland <[email protected]>
1 parent 2c3fa6a commit f6f7418

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/dlm/lock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,7 +1810,6 @@ static void shrink_bucket(struct dlm_ls *ls, int b)
18101810
memcpy(ls->ls_remove_name, name, DLM_RESNAME_MAXLEN);
18111811
spin_unlock(&ls->ls_remove_spin);
18121812
spin_unlock(&ls->ls_rsbtbl[b].lock);
1813-
wake_up(&ls->ls_remove_wait);
18141813

18151814
send_remove(r);
18161815

@@ -1819,6 +1818,7 @@ static void shrink_bucket(struct dlm_ls *ls, int b)
18191818
ls->ls_remove_len = 0;
18201819
memset(ls->ls_remove_name, 0, DLM_RESNAME_MAXLEN);
18211820
spin_unlock(&ls->ls_remove_spin);
1821+
wake_up(&ls->ls_remove_wait);
18221822

18231823
dlm_free_rsb(r);
18241824
}
@@ -4096,7 +4096,6 @@ static void send_repeat_remove(struct dlm_ls *ls, char *ms_name, int len)
40964096
memcpy(ls->ls_remove_name, name, DLM_RESNAME_MAXLEN);
40974097
spin_unlock(&ls->ls_remove_spin);
40984098
spin_unlock(&ls->ls_rsbtbl[b].lock);
4099-
wake_up(&ls->ls_remove_wait);
41004099

41014100
rv = _create_message(ls, sizeof(struct dlm_message) + len,
41024101
dir_nodeid, DLM_MSG_REMOVE, &ms, &mh);
@@ -4112,6 +4111,7 @@ static void send_repeat_remove(struct dlm_ls *ls, char *ms_name, int len)
41124111
ls->ls_remove_len = 0;
41134112
memset(ls->ls_remove_name, 0, DLM_RESNAME_MAXLEN);
41144113
spin_unlock(&ls->ls_remove_spin);
4114+
wake_up(&ls->ls_remove_wait);
41154115
}
41164116

41174117
static int receive_request(struct dlm_ls *ls, struct dlm_message *ms)

0 commit comments

Comments
 (0)