linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Teigland <teigland@redhat.com>
To: Jia-Ju Bai <baijiaju1990@gmail.com>
Cc: cluster-devel@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [BUG] fs: dlm: possible ABBA deadlock
Date: Thu, 19 Aug 2021 10:55:09 -0500	[thread overview]
Message-ID: <20210819155509.GB21218@redhat.com> (raw)
In-Reply-To: <79f8d302-f53f-3891-965a-bcb460ab15ca@gmail.com>

On Thu, Aug 19, 2021 at 04:54:57PM +0800, Jia-Ju Bai wrote:
> Hello,
> 
> My static analysis tool reports a possible ABBA deadlock in the dlm
> filesystem in Linux 5.10:
> 
> dlm_recover_waiters_pre()
>   mutex_lock(&ls->ls_waiters_mutex); --> line 5130
>   recover_convert_waiter()
>     _receive_convert_reply()
>       lock_rsb()
>         mutex_lock(&r->res_mutex); --> line 69
> 
> dlm_recover_waiters_post()
>   lock_rsb()
>     mutex_lock(&r->res_mutex); --> line 69
>   mutex_lock(&ls->ls_waiters_mutex); --> line 5307
> 
> When dlm_recover_waiters_pre() and dlm_recover_waiters_post() are
> concurrently executed, the deadlock can occur.
> 
> I am not quite sure whether this possible deadlock is real and how to fix it
> if it is real.
> Any feedback would be appreciated, thanks :)

They won't be concurrent, "pre" runs before recovery, and "post" is after.
Dave


  reply	other threads:[~2021-08-19 15:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19  8:54 [BUG] fs: dlm: possible ABBA deadlock Jia-Ju Bai
2021-08-19 15:55 ` David Teigland [this message]
2021-08-20  8:16   ` Jia-Ju Bai

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=20210819155509.GB21218@redhat.com \
    --to=teigland@redhat.com \
    --cc=baijiaju1990@gmail.com \
    --cc=cluster-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /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).