Thread (9 messages) 9 messages, 2 authors, 2015-05-08

Re: Potential race in dlm based messaging md-cluster.c

From: Lidong Zhong <hidden>
Date: 2015-05-05 09:22:52

quoted
quoted
On 5/1/2015 at 02:36 AM, in message [ref], Abhijit
Bhopatkar [off-list ref] wrote: 
There is a possibility of a receiver losing out on messages in certain  
corner conditions. One of the buggy case is if there is are two sender  
ready with messages to be sent. Sender 1 initially gets the TOKEN lock  
and proceeds. 
After initial processing the sender of message 1 _will_ release TOKEN as  
soon as receiver releases ACK, it does not wait till ACK CR is  
re-acquired by receiver. 
 
To illustrate the problem consider timeline for two senders and one  
receiver (we will ignore receive part for Sender2 node) 
 
Sender1              Sender2                         Receiver 
Get EX on TOKEN       Get EX on TOKEN 
<Granted>                    <Wait till granted> 
 
Get EX on MSG 
write LVB 
down MSG to CR 
Get EX of ACK 
<wait till granted>                                                      
      BAST for ACK 
                                                             Get CR on MSG 
                     read LVB 
                     process 
                     release ACK 
AST for ACK 
down ACK to CR 
release MSG 
release TOKEN 
                    <granted> 
                    Get EX on MSG 
I am afraid this corner case could not be achieved ever. Sender2 will be blocked on getting 
EX lock on MSG resource until the receivers release the lock. The receivers' request on 
upconverting CR to EX on MSG should be put into the convert queue before Sender2's 
request being put into the wait queue, because sender2 has to wait until the EX on TOKEN 
is released.

Regards,
Lidong
 
                    <... proceed ...> 
                    release TOKEN 
  <lost one message> 
^^^^^^^^^^^^^^^^^ 
                                                              Get EX on MSG 
                                                              Get CR on ACK 
release MSG 
 
 
Abhijit 
-- 
To unsubscribe from this list: send the line "unsubscribe linux-raid" in 
the body of a message to majordomo@vger.kernel.org 
More majordomo info at  http://vger.kernel.org/majordomo-info.html 
 
 
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help