Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp691211pxb; Thu, 19 Aug 2021 08:59:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcewo/542jJBZ5bDbxSqouBdeIdFHPGfeu0zjO/BL3gsdwUQOk+P8YCfpeW3eW0SbpuPPu X-Received: by 2002:a05:6402:152:: with SMTP id s18mr16932344edu.221.1629388768934; Thu, 19 Aug 2021 08:59:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629388768; cv=none; d=google.com; s=arc-20160816; b=MyFTCjcpkLotCwGkgd4t9FOmujF3Aic8ZT2lhaqzJbe8tbmezANrg0Uir72t7jpgGs 0ChcZc2FsDl2a78+k7XYADCRiIeoqYOJaspjaKh/wQXl5WWaEC8AvjVTAT3cTZPcNM1f ruIZf2llIto0uwcwbHkrVNkr3onAeatLk4X1VYOImA2xhk5qI/I3lIc1d82Qab1Eins8 EjTM3u/OHQaHfbNIiiPqTUD5U0NgP1OzoJ2RunOFlNQGQdokes3F0pcdUy1SGCMzEf6t /HXkzLdszC0VRHhn66mkNkkoUc7bvLZOU9UXdn/v97Bltq9zXryfHDxPHdCJLBSyh+R5 WAEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=pmp4Kw5okIF5wwBbrjrJBs+O1tcqAHxdEgDPFxbvKOQ=; b=e6iNyoOOXIWN05EoM6C6o2crSYjKdWNH5b+BWfcDoJWiU1hTtQ2ZryiywxFCMsU0gI GaoDeYkKwF1oRPe6zQDjg6odAgTxOXOaX7zuwhu3i0kAbY4uNVoWi6chcnjlqQSWZqC4 33AWE9DTGPjznxz2QXVH9bbpMySXtfAmoWhKpg+79XvBq+YDHUZzzf3DMETeVZ6eFteB RC0hp+LZ3Y9/m0yhEolhoywKzDg4aPuEDHBhy4Y5q7CempQHC6yZ+bAcgQvs7dYYv3p0 VVvG1o1Z6HtxWWhc9kikgXnayjIhucmoLd3RugtRUpdndjM+NTOkcIT+7LFO6vRArbFH 75Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Hq6mlylS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds7si4715456ejc.524.2021.08.19.08.59.05; Thu, 19 Aug 2021 08:59:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Hq6mlylS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240583AbhHSP4C (ORCPT + 99 others); Thu, 19 Aug 2021 11:56:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:48970 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238753AbhHSPz6 (ORCPT ); Thu, 19 Aug 2021 11:55:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629388521; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pmp4Kw5okIF5wwBbrjrJBs+O1tcqAHxdEgDPFxbvKOQ=; b=Hq6mlylSKbjn4oPTOjyHNmeH2gB5jNcHZynbhJ+MhkUTbOjHset8vPUW+0YPmMEmDUzLTd 3iU2b5aYzrRpvdBewnTLncnnFNB8fHlgVZXUTlq5KzXfZMYbEq9DX4zkp13pNdvXG4CxVI jJmxtCdgyGENCeGnnlaw9hXgmeqkRkg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-121-7RTWZI9gOJCZx4QlD894jA-1; Thu, 19 Aug 2021 11:55:20 -0400 X-MC-Unique: 7RTWZI9gOJCZx4QlD894jA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3E6A087D573; Thu, 19 Aug 2021 15:55:19 +0000 (UTC) Received: from redhat.com (unknown [10.15.80.136]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B7AF3421F; Thu, 19 Aug 2021 15:55:11 +0000 (UTC) Date: Thu, 19 Aug 2021 10:55:09 -0500 From: David Teigland To: Jia-Ju Bai Cc: cluster-devel@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [BUG] fs: dlm: possible ABBA deadlock Message-ID: <20210819155509.GB21218@redhat.com> References: <79f8d302-f53f-3891-965a-bcb460ab15ca@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <79f8d302-f53f-3891-965a-bcb460ab15ca@gmail.com> User-Agent: Mutt/1.8.3 (2017-05-23) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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