Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1319553pxb; Fri, 20 Aug 2021 03:03:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIUpgMSW06mOGNZcQnRntK9RKBOtQCvgtJZc8O8W8SHXNZnuG3YKdiH92BCdd+BWOO8/qt X-Received: by 2002:a92:ca89:: with SMTP id t9mr13592587ilo.178.1629453789886; Fri, 20 Aug 2021 03:03:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629453789; cv=none; d=google.com; s=arc-20160816; b=cUR01exuqifqoxoKJ7D5/ScDC/+WeBk0+K9OhFNwsZbb+lmxIOgEMMLVhz2XQAF4+a PTKtDazfssTj9090uYF0peEsuuxcplkedjxV1Mz+DLoN+OnCdFKpsTL/OE9c14Vgixjf uHcK/AdQao9z9y6nDA2vn9NRS9FPMjL8e3Z7yeOAMWqRaAMxkchfVTE/ggV1POa17enA FxwMAie3Kh7Kh2L/LuOaEojw66gzHfY2vDD19A+7QvJQvhOz6rA2lU30b2W9G2d8HRYF IXZO/2MwIe+OEfbloYyzTlRBmlaO4Uf3IdJ8slyUdMpoI36+5rDzqISqZlB07gugE55I f0Pg== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=prkgxsjc6P5xCYXDSgwxay/DjjwNED1qEpDrLXac72s=; b=CVRm6p9OJ4NbH+CtI3qEz/3tCd5LsPylQQwAPukhCQYqZJCknOFdt1gAlYDEWws7sx oS36W6orss3UKm7CE/JKe+DSvBuXnSDNIEFLwdBXvEsj6W86jxmcVU6EBxIZndJVUKSx w/MilXO/siPEiKQjPttoHstDUEP6UDYBlcxUMQE/To1DsGMqRzzZSYbkuVYNEzaO2qPP sxMh3uOTZAhF9CylzsrbFMkI3CAk8e8irWad6x8OE2Tnmvcr7Yg1zKxOMEBfMX1DcQ6E ohmYd2T/Ovw+z8fQhkxNOx/J4HIMcGSfJDF+o+NcmGcBUmfGZA5onOuAWToAp05SUuAq ZRvg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p19si7504398iov.90.2021.08.20.03.02.58; Fri, 20 Aug 2021 03:03:09 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237267AbhHTKCn (ORCPT + 99 others); Fri, 20 Aug 2021 06:02:43 -0400 Received: from verein.lst.de ([213.95.11.211]:40428 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237139AbhHTKCm (ORCPT ); Fri, 20 Aug 2021 06:02:42 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 446A26736F; Fri, 20 Aug 2021 12:02:03 +0200 (CEST) Date: Fri, 20 Aug 2021 12:02:02 +0200 From: Christoph Hellwig To: Hillf Danton Cc: Sven Schnelle , Josef Bacik , Christoph Hellwig , Jens Axboe , linux-block@vger.kernel.org, nbd@other.debian.org, linux-kernel@vger.kernel.org Subject: Re: WARNING: possible circular locking dependency detected in nbd Message-ID: <20210820100202.GB9872@lst.de> References: <20210819072938.3839-1-hdanton@sina.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210819072938.3839-1-hdanton@sina.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 19, 2021 at 03:29:38PM +0800, Hillf Danton wrote: > On Wed, 18 Aug 2021 09:10:49 +0200 Sven Schnelle wrote: > > Hi, > > > > i'm seeing the lockdep splat below in CI. I think this is because > > Thanks for reporting it. > > > nbd_open is called with disk->open_mutex held, and acquires > > nbd_index_mutex. However, nbd_put() first takes the nbd_index_lock, > > and calls del_gendisk, which locks disk->open_mutex, so the order is > > reversed. > > Right. See diff attached. This is already fixed in linux-next.