From: Jia-Ju Bai Date: Fri, 20 Aug 2021 16:16:02 +0800 Subject: [Cluster-devel] [BUG] fs: dlm: possible ABBA deadlock In-Reply-To: <20210819155509.GB21218@redhat.com> References: <79f8d302-f53f-3891-965a-bcb460ab15ca@gmail.com> <20210819155509.GB21218@redhat.com> Message-ID: List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On 2021/8/19 23:55, David Teigland wrote: > 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. Okay, thanks for your reply :) Best wishes, Jia-Ju Bai