[DLM] fix requestqueue race
Red Hat BZ 211914 There's a race between dlm_recoverd (1) enabling locking and (2) clearing out the requestqueue, and dlm_recvd (1) checking if locking is enabled and (2) adding a message to the requestqueue. An order of recoverd(1), recvd(1), recvd(2), recoverd(2) will result in a message being left on the requestqueue. The fix is to have dlm_recvd check if dlm_recoverd has enabled locking after taking the mutex for the requestqueue and if it has processing the message instead of queueing it. Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
这个提交包含在:
@@ -3028,10 +3028,17 @@ int dlm_receive_message(struct dlm_header *hd, int nodeid, int recovery)
|
||||
|
||||
while (1) {
|
||||
if (dlm_locking_stopped(ls)) {
|
||||
if (!recovery)
|
||||
dlm_add_requestqueue(ls, nodeid, hd);
|
||||
error = -EINTR;
|
||||
goto out;
|
||||
if (recovery) {
|
||||
error = -EINTR;
|
||||
goto out;
|
||||
}
|
||||
error = dlm_add_requestqueue(ls, nodeid, hd);
|
||||
if (error == -EAGAIN)
|
||||
continue;
|
||||
else {
|
||||
error = -EINTR;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
if (lock_recovery_try(ls))
|
||||
|
在新工单中引用
屏蔽一个用户