From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9186C4167B for ; Tue, 31 Oct 2023 06:27:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236037AbjJaG1M (ORCPT ); Tue, 31 Oct 2023 02:27:12 -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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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