Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp212364rwe; Wed, 31 Aug 2022 20:08:52 -0700 (PDT) X-Google-Smtp-Source: AA6agR7HAjj8u92ToiiC2Jh42w73mfhvi32GfWdZZcbh4SOdPhm5SLwSWg3qDc0HIzU4zIuq0cxD X-Received: by 2002:a17:906:6dd3:b0:742:296d:15c8 with SMTP id j19-20020a1709066dd300b00742296d15c8mr7444167ejt.550.1662001732200; Wed, 31 Aug 2022 20:08:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662001732; cv=none; d=google.com; s=arc-20160816; b=OW1Sln/gTLoBnaEf70yzqeMWnqyynhXTsOGn0NB37bcGK4DAsruYlFnMwv10ojGkT0 euZ/gq5VMPt+fiSZn0HIaG+DXINXP08b89cNZvW+qvjZvYmdQz3dYkIi25IlMjjLhdYp GPI2IPob0fBi3O8h2IZZFf3PErn7fhRsRUgfq6kbVv8jMfmNsBn3mCToWmDbZZ55dkhc JxhK7LLuzPnPtJNK4lhb6xcyxEIiEU3mPj1PHe2gaRzrj/D6d4/ZCyjXlaBngyGD1B7U A56jziM0Zvgg7fxse8gy4f5Uzftlbl1GnWc8sopEJrdwbJHPEiniDlmdXgxUfkaTmLyK 8Zgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:in-reply-to:date:subject :cc:to:from:user-agent:references:dkim-signature; bh=eVRGKtfHojTP92sNkJnJ80bmZvj7fSvzpyBR/tNw3ks=; b=hIq4WsniqcdhxMEti9VGdDAbEnnjHY0aftIYodgqKpK5FWhsk0LEOBwd6WRy6dfz48 XLnx2+gK7dNfdD5v92EMpvn6T7Ua0qf0cFWjEbMIPYL4Eo8ST9iSbvyZ3hLL8lpL0hBa WrvSKQ9SZqvMX1TwIW1yLEqzodXCFu7ji2E25F4e6xPrSSO/QDRDPvrToq5r6/ka93Cv cDL7U52tzijKkzyIRqpwPSfe4DNPzOeIRrkd4BhcPEe+yaWdHn2aADusb9l3WEn7k127 EJA8EsA13ZuyzS6sDUoxqwkbgR3+kzzpqH0j5yhYemUfRyGR5/4H5feM9hKTOTwruQaL EgiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Z9FrDCeL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id tl24-20020a170907c31800b0073d8cfa8070si8564130ejc.271.2022.08.31.20.08.15; Wed, 31 Aug 2022 20:08:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Z9FrDCeL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232538AbiIAC7l (ORCPT + 99 others); Wed, 31 Aug 2022 22:59:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232476AbiIAC7j (ORCPT ); Wed, 31 Aug 2022 22:59:39 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2AEE162155; Wed, 31 Aug 2022 19:59:36 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id q63so15132004pga.9; Wed, 31 Aug 2022 19:59:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date; bh=eVRGKtfHojTP92sNkJnJ80bmZvj7fSvzpyBR/tNw3ks=; b=Z9FrDCeLSWgX3RZSj2UxqAE8u1GU8ozB47W0KevNli961D6+XCr2sF2kcSXaA+mt66 bp87G2N6IE6JEEcNo1WYs8rR2EccX6rR0XhQyZBnFmGVaLNzRFolalJog6YKLv0q0Ll0 Iuhu8EM2+R8jTPoQ++idc26GxuhUB0bqI7viJ8EombycdKbAQv+9ELLx8wF1wD3Ah4DF AK+DRoOfJJlmYOF35lFIk4kQqQrwxUqbvuMCal9AGB29iH0bPHG+uRyWnn+SlfoJTdgy R0bvt56TLQBY9gD2W48QpXXgio08W9g76BJSe6OCzoR6EIpPimc3XDvF7H1fN8qaSEfr eoXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date; bh=eVRGKtfHojTP92sNkJnJ80bmZvj7fSvzpyBR/tNw3ks=; b=Q9ZGn3m9HSW/BFMpgxNdAggh4wNq6XV1tWCmp59WK3GyLX+UA85g3nQcL3lGT3+sTT 0czygwIr1KXNzXOvI4Z5zAR9VBXC7qmHCnrw5bX73BhJXetexUoKgLDF2nPrtermG5jf YUL9tzZK5xv0gWt1TWAJeUEp0nZZoTWjvpBoAEQeMW2QWxPVh3CpOUO4RcxMFJy+FZJ4 pC1ov9T+gup2+3zalQhvltz4lt4pfDsi4WObyKt5yNiNgl5MsvQ3zqDa6UwpO30st8fl UnSY/NGVDRNnzaidJD1TdO0v3eKSfuoHcpOklg+W5f+k0TpSDr7zD66y68KK2vhGjukq vq5Q== X-Gm-Message-State: ACgBeo3rnQ++vPR92FjUaEpoyT0LmzRTNxXvTrmkw4FELlmMn6wdHNSd gj+CdV/QpNZQBgKJFyTtrWrQWcffCCXPyw== X-Received: by 2002:a63:5715:0:b0:42a:d7a4:4c30 with SMTP id l21-20020a635715000000b0042ad7a44c30mr24290092pgb.525.1662001176034; Wed, 31 Aug 2022 19:59:36 -0700 (PDT) Received: from MBP ([39.170.101.209]) by smtp.gmail.com with ESMTPSA id u6-20020a654c06000000b0043057fe66c0sm1014591pgq.48.2022.08.31.19.59.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Aug 2022 19:59:35 -0700 (PDT) References: <20220831180950.76907-1-schspa@gmail.com> User-agent: mu4e 1.6.10; emacs 27.2 From: Schspa Shi To: asmadeus@codewreck.org Cc: ericvh@gmail.com, lucho@ionkov.net, linux_oss@crudebyte.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, v9fs-developer@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] p9: trans_fd: Fix deadlock when connection cancel Date: Thu, 01 Sep 2022 10:55:36 +0800 In-reply-to: Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org asmadeus@codewreck.org writes: > Schspa Shi wrote on Thu, Sep 01, 2022 at 02:09:50AM +0800: >> To fix it, we can add extra reference counter to avoid deadlock, and >> decrease it after we unlock the client->lock. > > Thanks for the patch! > > Unfortunately I already sent a slightly different version to the list, > hidden in another syzbot thread, here: > https://lkml.kernel.org/r/YvyD053bdbGE9xoo@codewreck.org > > (yes, sorry, not exactly somewhere I'd expect someone to find it... 9p > hasn't had many contributors recently) > > > Basically instead of taking an extra lock I just released the client > lock before calling p9_client_cb, so it shouldn't hang anymore. > > We don't need the lock to call the cb as in p9_conn_cancel we already > won't accept any new request and by this point the requests are in a > local list that isn't shared anywhere. > Ok, thank you for pointing that out. > If you have a test setup, would you mind testing my patch? > That's the main reason I was delaying pushing it. > I have test it with my enviroment, it not hang anymore. > Since you went out of your way to make this patch if you agree with my > approach I don't mind adding your sign off or another mark of having > worked on it. > > Thank you, -- BRs Schspa Shi