Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp51110rdb; Mon, 30 Oct 2023 23:27:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHcSdpwlsWcrMwpkCGu58ML9MqzZP86vmLpXAWyHq41C5NHJaZXVl70EBtAaXmAJ3J4EiWX X-Received: by 2002:a05:6a21:3d8d:b0:180:d66b:7f1 with SMTP id bj13-20020a056a213d8d00b00180d66b07f1mr2896792pzc.62.1698733640919; Mon, 30 Oct 2023 23:27:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698733640; cv=none; d=google.com; s=arc-20160816; b=UHyI67UpZi7RznjLzMtA51or+BZntbtnKvl92pBpf3vtdyGJPbQjBkobW8JVloCDPz 1+L8jyjs5mQpdseXgX7o6f/i6Fryir5ZNBQNM3PI84q3mOGLzCuOnFcxQQ8IrGb9WRs5 ivAEV21sSgG/KBIQkYDAuxbuP0O+zCKMUraAjvJG1OpoMHZDBo68gC8jeLv3SSRVXwYG 02qYCzgt0ionD9k9czL4xw1FmNyWqDV5zSLLxNbmixpQ30KZ8HrZcZDDUuzchiB9Jv1k W0jbNh4trzGjM11RJCZk6NFu6F1vUFLAbeWutkUCplWhn+f3t4cVSsiWFbj9XYLKKLyt RT+w== 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:subject:user-agent:mime-version:date:message-id; bh=SPGbesF2lXRInCu4cB0yOJVNIysn5HuQvBvKCS70b+0=; fh=26XAB1+8U9xAQLHt38yPPZAf+eF2GdcYWML61wYI9Qw=; b=WTrdMQd7UJMFTb7a1HpfJdy++FaERIQmDrJA7oNktEcZk/6F9wyyuJ6sDRLrAkRnog SnE0ziFgnw//vB8CpZg0CNMl1icEh0Sg3t6j5OOS1xC6ff3uJ5kWmpZGBT8nkGdCEvbU bpx3Eijm8By9/MNC8BE4GESlm2/ulvFPH2QmZPfJls0Zi/mrL6I/S8WAjAJltLp5e7rk RX7PwsGB5uxKYArMP04aITacaIDUnPOYcdAUKj8fRtuwwu5Q+ztMnfYYjl9KiBYwQUlS G2UUs+OXcI5rNZ77easA7LhzqzQ/UT/IyY3TWs03uWIukfVCKDN+ETGhWLnQPtYsFMMi SMDA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id ka5-20020a056a00938500b006bf2ef1717csi552659pfb.255.2023.10.30.23.27.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 23:27:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 318E280A6EE0; Mon, 30 Oct 2023 23:27:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235564AbjJaG1L (ORCPT + 99 others); Tue, 31 Oct 2023 02:27:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbjJaG1J (ORCPT ); Tue, 31 Oct 2023 02:27:09 -0400 Received: from out30-97.freemail.mail.aliyun.com (out30-97.freemail.mail.aliyun.com [115.124.30.97]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3FC4C0 for ; Mon, 30 Oct 2023 23:27:04 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R561e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046059;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=3;SR=0;TI=SMTPD_---0VvGHJmL_1698733618; Received: from 30.221.133.171(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0VvGHJmL_1698733618) by smtp.aliyun-inc.com; Tue, 31 Oct 2023 14:27:00 +0800 Message-ID: <59d16fd0-4a9f-b293-18f8-58ed3250ea6c@linux.alibaba.com> Date: Tue, 31 Oct 2023 14:26:57 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [PATCH] erofs: fix erofs_insert_workgroup() lockref usage To: Linus Torvalds Cc: linux-erofs@lists.ozlabs.org, LKML References: <20231031060524.1103921-1-hsiangkao@linux.alibaba.com> From: Gao Xiang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.2 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 30 Oct 2023 23:27:18 -0700 (PDT) On 2023/10/31 14:20, Linus Torvalds wrote: > On Mon, 30 Oct 2023 at 20:08, Gao Xiang wrote: >> >> As Linus pointed out [1], lockref_put_return() is fundamentally >> designed to be something that can fail. It behaves as a fastpath-only >> thing, and the failure case needs to be handled anyway. >> >> Actually, since the new pcluster was just allocated without being >> populated, it won't be accessed by others until it is inserted into >> XArray, so lockref helpers are actually unneeded here. >> >> Let's just set the proper reference count on initializing. > > From a quick superficial look this looks like the right approach. > Thanks for the quick response. Thanks, I will trigger a stress test for this and it will be included in this pull request... Thanks, Gao Xiang > > Linus