Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp1994163rwb; Sun, 4 Sep 2022 06:20:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR6tGWOquKeWTY4vRxiXFT5+Zj+39DXTHRurt53f0mMdpAX04TNol/bX1MkBmRYlEPMHLX8A X-Received: by 2002:a17:907:7f24:b0:731:535e:b709 with SMTP id qf36-20020a1709077f2400b00731535eb709mr32864539ejc.160.1662297623235; Sun, 04 Sep 2022 06:20:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662297623; cv=none; d=google.com; s=arc-20160816; b=VYMDbfG7ajCF8y+PXsheYTF/gnctyP0ZpxJxysLMK6x2aNzHlKrT70zW7K8DtrRN9h LxuAgg6CeesQwe0jQlxFbcVIolwVDiJNCK8ZLhS//xU0Zo5ZT2Ff4mBLNYOB+bn5EpPW bOP1AQwyXrOJw8UNrTd/6ZfIXiDGPHGogcmZtzoJK/2n9+v1YjD8TUxoFrDOx83d6PK6 2hOG2csvRVQbP/JTiJ1d5ZWbxUNwUoD4e0Tg0U20h6eaYwMm3IRPfrICczDNK7wXaxjy VETEj4fYdlM0AQ5tu1YKgWVMT9w5s5+TccbOMdXOYd7wKSUzPdO6U14ENZLMOKb8oNQ1 m++A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=7HaFXZ8ajSTqa0Xswdu6pOXEfy8J08H5vbowfZykETI=; b=MRe53l8fmjhIRnMC30IHOtcXK3jWNuYrB4vc1DRCGf4rSdr8AoLoTrHECP/YRvN+45 9XdO0fnQ0Z2PWjNdBfAMQQssM6khjOTE4NPZUB+6VSin1+MBoEwXMKzEkNGcLgnZsaK1 Lz0ggFj5p39iTLR7LDEIuA0bfTtnkhWQ30kGnKSkUsbA7MoNZGowqiAsHMPpfwXxvfmh UhAxR0j3NP6oksFQncnj8f6JAHMPIKihmKjE5I4AlWeAceunZy1wb85dvbUJcEJyydxG CW28xZN89maJjkpZSJ+ELGjXqduRM64m2fW0hTv081OqFfF2hP4eSkAVmWPzUhDLZobC ML4A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p13-20020a056402154d00b0044da16b4e30si2251597edx.306.2022.09.04.06.19.51; Sun, 04 Sep 2022 06:20:23 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233361AbiIDNEd (ORCPT + 99 others); Sun, 4 Sep 2022 09:04:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231359AbiIDNEa (ORCPT ); Sun, 4 Sep 2022 09:04:30 -0400 Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB923E9A for ; Sun, 4 Sep 2022 06:04:24 -0700 (PDT) Received: from fsav312.sakura.ne.jp (fsav312.sakura.ne.jp [153.120.85.143]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 284D3o68045784; Sun, 4 Sep 2022 22:03:50 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav312.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav312.sakura.ne.jp); Sun, 04 Sep 2022 22:03:50 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav312.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 284D3o0C045779 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Sun, 4 Sep 2022 22:03:50 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Message-ID: <9d4c7f38-6a30-3efb-7887-9c6224494ffd@I-love.SAKURA.ne.jp> Date: Sun, 4 Sep 2022 22:03:49 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH] net/9p: use a dedicated spinlock for trans_fd Content-Language: en-US To: Dominique Martinet , v9fs-developer@lists.sourceforge.net Cc: syzkaller-bugs@googlegroups.com, linux_oss@crudebyte.com, linux-kernel@vger.kernel.org, syzbot References: <2470e028-9b05-2013-7198-1fdad071d999@I-love.SAKURA.ne.jp> <20220904112928.1308799-1-asmadeus@codewreck.org> From: Tetsuo Handa In-Reply-To: <20220904112928.1308799-1-asmadeus@codewreck.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_NONE,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 On 2022/09/04 20:29, Dominique Martinet wrote: > Since the locks actually protect different things in client.c and in > trans_fd.c, just replace trans_fd.c's lock by a new one specific to the > transport instead of using spin_lock_irq* variants everywhere > (client.c's protect the idr for tag allocations, while > trans_fd.c's protects its own req list and request status field > that acts as the transport's state machine) OK, I figured out what this patch changes. $ grep -nF -- '->lock' *.[ch] client.c:286: spin_lock_irq(&c->lock); client.c:293: spin_unlock_irq(&c->lock); client.c:367: spin_lock_irqsave(&c->lock, flags); client.c:369: spin_unlock_irqrestore(&c->lock, flags); client.c:816: spin_lock_irq(&clnt->lock); client.c:819: spin_unlock_irq(&clnt->lock); client.c:838: spin_lock_irqsave(&clnt->lock, flags); client.c:840: spin_unlock_irqrestore(&clnt->lock, flags); client.c:945: spin_lock_init(&clnt->lock); trans_virtio.c:139: spin_lock_irqsave(&chan->lock, flags); trans_virtio.c:151: spin_unlock_irqrestore(&chan->lock, flags); trans_virtio.c:268: spin_lock_irqsave(&chan->lock, flags); trans_virtio.c:287: spin_unlock_irqrestore(&chan->lock, flags); trans_virtio.c:296: spin_unlock_irqrestore(&chan->lock, flags); trans_virtio.c:303: spin_unlock_irqrestore(&chan->lock, flags); trans_virtio.c:474: spin_lock_irqsave(&chan->lock, flags); trans_virtio.c:515: spin_unlock_irqrestore(&chan->lock, flags); trans_virtio.c:524: spin_unlock_irqrestore(&chan->lock, flags); trans_virtio.c:532: spin_unlock_irqrestore(&chan->lock, flags); trans_virtio.c:621: spin_lock_init(&chan->lock); trans_xen.c:142: spin_lock_irqsave(&ring->lock, flags); trans_xen.c:149: spin_unlock_irqrestore(&ring->lock, flags); trans_xen.c:164: spin_unlock_irqrestore(&ring->lock, flags); trans_xen.c:314: spin_lock_init(&ring->lock); This patch changes "struct p9_client"->lock to be used for only protecting idr, as explained at * @lock: protect @fids and @reqs line. Makes sense and looks correct. > Tetsuo Handa-san, thank you very much! > I'm sorry for not respecting your opinion but it's been a pleasure to > have submissions from someone on JST :) Thank you for responding quickly. :-)