linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Abhijit Bhopatkar <abhopatk@cisco.com>
To: Goldwyn Rodrigues <rgoldwyn@suse.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: Potential race in dlm based messaging md-cluster.c
Date: Fri, 01 May 2015 00:17:43 +0530	[thread overview]
Message-ID: <554278CF.4000401@cisco.com> (raw)
In-Reply-To: <5542763C.90202@cisco.com>

On 01/05/15 12:06 am, Abhijit Bhopatkar 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.
>
I could not come up with any solution except to add one more lock
resource for now we will call it "SYNC"

Sender 1             Sender2                  Receiver
Get EX on TOKEN      Get EX on TOKEN
Get EX on SYNC       <Wait till granted>
<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>
                                               Queue EX on SYNC
                                               release ACK
AST for ACK
down ACK to CR
release MSG
release SYNC
release TOKEN
                                                SYNC  granted
                     <granted>
                     Get EX on SYNC
                     <wait till grant>
                                                Get EX on MSG
                                                Get CR on ACK
                                                release MSG
                                                release SYNC

                     Get EX on MSG
                     <....proceed rest>
                     release TOKEN

The key thing to note here is that the SYNC lock request is only queued
in receiver path. Having worked in dlm before I know for sure this will
work as expected.

Abhijit



  reply	other threads:[~2015-04-30 18:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAE3Hb8oss1JZ2u7g7OQQgrEtgQ1vbQou04isiS6eEqbS=uzbhw@mail.gmail.com>
     [not found] ` <CAE3Hb8qNczD30RrcHFYCR90Jf9QFD-XH=x89MAu4Dpmm80se0A@mail.gmail.com>
     [not found]   ` <554251EA.3000807@suse.com>
     [not found]     ` <CAE3Hb8pJ=0MB6EX5jVch28gj-gnf0Mp1wyzxBfWjzLf=SuV4sQ@mail.gmail.com>
2015-04-30 18:36       ` Potential race in dlm based messaging md-cluster.c Abhijit Bhopatkar
2015-04-30 18:47         ` Abhijit Bhopatkar [this message]
2015-04-30 18:51           ` Abhijit Bhopatkar
2015-05-05  9:22         ` Lidong Zhong
2015-05-05  9:44           ` Abhijit Bhopatkar
2015-05-05 12:10             ` Abhijit Bhopatkar
2015-05-07  2:43               ` Lidong Zhong
2015-05-07  9:14                 ` Abhijit Bhopatkar
2015-05-08  5:06                   ` Lidong Zhong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=554278CF.4000401@cisco.com \
    --to=abhopatk@cisco.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=rgoldwyn@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).