Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp2052264pxv; Sat, 17 Jul 2021 02:42:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFU3ecNM1n7/Ol01VrY/wzVF57c9gSsKZF0+h0pAr81g4R1sUlPszSThZYayCDJPia/Khx X-Received: by 2002:a17:906:a18b:: with SMTP id s11mr16996156ejy.8.1626514955278; Sat, 17 Jul 2021 02:42:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626514955; cv=none; d=google.com; s=arc-20160816; b=dOFDwF1kaD2GI9o1khymS2EMTxyNiBY/u6nb6lVzvHHxyi0Pdld24M0dY+B5se3tUh U+QdZ/pCO3a/UHq8OGY+UZR7ZqbK/bovEJt+FuwbQcuMFyQ3gbeYpKngR77zUynSHFOU bl/M2PnDSQoXLTGwkbI+jwHTMF0cNSXCbxu36ScG6cEmivIuvCjSwXOfKp3/nNCZuSwi 8WyCFho9m4DGZK6lyRxXS5VPkR/6foaQRFlcJ+HiPtKFkzZ/1dVSLg/Ab1w2z24d87Fw vtv+sDTKW7CtYpbgPc4uUsOErqGb6g6+EUSSpOMzma2CYXgrcr6ENOOkVyPIkf32dU7M NnUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=5yIJkQt3GFQl4d9x0leKlizsNtZXqf9kI+djIJdlY34=; b=NoAecmKl+ZkT1lb/aIBSM1By57UmcvOi6BPVrMpq51czW9X7E6syypMe2LW6hUMBSK LRJ1HucMmS5xaRpuxq9HhIxwUpLe5sorq0t5KDobjRtFED2hTUs/wtuj07VBR7++zSCk q0snh0/2ojoiP595IQIZutSyQZ62pH/aOEzTn/2u7WVRVbGqn6YI4xB6amhGlZHYzgg6 rEIwV8Ge+R4UQS7EUeEUPmzIQ4nori1GJVF2ov4KJTEYj0qXkWTuh6TVbP/y++9F1vKi fegznrwwTnEmSUHp6vYBidmo9jGFD9WS9aXgLczI8mGNAYzdchaixJ4/IH9SWjTWBsZF Hl+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jDur00L7; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cs17si14233082ejc.65.2021.07.17.02.42.11; Sat, 17 Jul 2021 02:42:35 -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=@gmail.com header.s=20161025 header.b=jDur00L7; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232871AbhGQJoG (ORCPT + 99 others); Sat, 17 Jul 2021 05:44:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231716AbhGQJoF (ORCPT ); Sat, 17 Jul 2021 05:44:05 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0128C06175F; Sat, 17 Jul 2021 02:41:08 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id d1so6590082plg.0; Sat, 17 Jul 2021 02:41:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=5yIJkQt3GFQl4d9x0leKlizsNtZXqf9kI+djIJdlY34=; b=jDur00L7znCQBRdMT8eZ6uE1OzbeM3CVkJa9zGog9JRTEtDpGcj1VgX88idel9uiDJ iQ8BBLIVgmvxe1rapcEoe9/84mcIURsjYwKS5fJSwMYA519Cv6tUXfCV2pfbzDQW/rGM qVKQdzJeZDmuax4Zcoi1ZuXBC+X6FrXIOVWeHSMaPZtIBmrleP0zy6fWRd12iMBZ2HAk 2YONGql4n7Eo6kJ5BFfmaG034Pj+J4JZxvKBbQjBCcdDOCC86Qc11IJ/Kqw1Kj1TA9QR e5FGhf8GeyVIRVLfgAUDQ28YzNTs/UE2eaX6u4YbTGap/SH1kXYH/2XeczyVZNWA008h WwkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=5yIJkQt3GFQl4d9x0leKlizsNtZXqf9kI+djIJdlY34=; b=QUKo52JQaPC1vKc1S4ZsSqxYKBqb3FnGLlROl2Frks9KGzdc0ArrRNjpwUc2SRY1M7 qvrbabWBgKlE1A2goEKn4V7ZCztgfDGuvRYGaki5xaT93iiSBKFFgD0/N/NZH/xVLExz CPNcPUvHmNEfI5NcrKuwIKTPKV4b7psREJ4eK/QSukV/mKHMkh/VjzRpbAh8dCuiKN5z I5ahzUgfmePTIUQ1bimZ20TrIarpwwuptwABK9cnWFn5WS9m30BJk1f2rwnHvwG/i7YA 8vgf+AU4qzHbpd6GZaKLuqVSh1noI4vrHFvtrdIwmoVR5SCvov/eelus+1LqnvG5IerC au7w== X-Gm-Message-State: AOAM53399BgXx2jDGxZjX92J6ao0EhR6Qsaa/eOILAfsJ61XqkHXRbT8 OW+wrs7e+I8ixwd72nMKQDQ= X-Received: by 2002:a17:90b:1010:: with SMTP id gm16mr20332240pjb.192.1626514868316; Sat, 17 Jul 2021 02:41:08 -0700 (PDT) Received: from [192.168.1.237] ([118.200.190.93]) by smtp.gmail.com with ESMTPSA id q21sm13043739pff.55.2021.07.17.02.41.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 17 Jul 2021 02:41:07 -0700 (PDT) Subject: Re: [syzbot] possible deadlock in loop_add To: Miquel Raynal , Hillf Danton Cc: Christoph Hellwig , syzbot , axboe@kernel.dk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com References: <000000000000ec01e405c6c2cee3@google.com> <20210710131638.605-1-hdanton@sina.com> <20210712052740.GA8599@lst.de> <20210716010028.4218b0de@xps13> From: Desmond Cheong Zhi Xi Message-ID: <77da708c-b63d-dac0-c7e6-43ced0d49982@gmail.com> Date: Sat, 17 Jul 2021 17:41:03 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210716010028.4218b0de@xps13> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/7/21 7:00 am, Miquel Raynal wrote: > Hello, > > Desmond Cheong Zhi Xi wrote on Mon, 12 Jul > 2021 16:29:16 +0800: > >> On 12/7/21 1:27 pm, Christoph Hellwig wrote: >>> On Sat, Jul 10, 2021 at 09:16:38PM +0800, Hillf Danton wrote: >>>> To break the lock chain, un/register blkdev without mtd_table_mutex held. >>> >>> Yes, Desmond Cheong Zhi Xi sent pretty much the same patch on June 18th >>> (mtd: break circular locks in register_mtd_blktrans), but it did not get >>> picked up. >>> >> >> I believe Miquèl was waiting for -rc1 to apply it. > > Indeed, I already applied it but did not advertise yet. > Thanks Miquèl! >> >> But taking a closer look, although the fix for the register path is the same, Hillf Danton's proposed patch additionally avoids inverting the lock hierarchy on the unregister path. So I believe this new patch should be more robust. > > We can definitely do this in two steps if you want. > Sounds good, I'll prepare a patch with Hillf's suggestion for the unregister path. > Thanks, > Miquèl >