Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp49131rdb; Mon, 30 Oct 2023 23:20:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH3GNs4X+ZAjd7lcnhCbuXVV0RAKBFVSBPkCVYxulQ+8dhTWFwLhd1SVfFPTXoc0S+9czG5 X-Received: by 2002:a17:903:22d1:b0:1ca:b8d3:f880 with SMTP id y17-20020a17090322d100b001cab8d3f880mr2438541plg.20.1698733251138; Mon, 30 Oct 2023 23:20:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698733251; cv=none; d=google.com; s=arc-20160816; b=B+UefV15d1zK+qU4iuKrTHQ2DOuaILhtZ7p0u3iAzQNv5qerWRMJ6N62rpcakVz0k4 0hBEEAh5IUwS6o+yo1atqbefDwd99g0eEbZd/oM9Vg1omMxteIRf9mRUq49P7rvuYZdK SnpojOL3/N89m+vuKHPHGkMBjRIsA5wA3pZATBAZKC1rXI08y8z9bXKw3QXyq/ptAoNv uCTcpkHTm4GxFed2khx07cW6ugSY8TCwBqg61bMagSAQbY5tiEsfsCMDnTN4Rpgysx9f L9SIfo+tXzNQuKU6zSWl0nNezzi5fWX8qJDh/qdjoNl9DEns6MpEt95kR0JeElF0ZcOi NJeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=iDMKed0nzokCCbEBIpnlAR25vjS6WyJ1gGNxVZ8+dQM=; fh=Ei3aEq29es1j/tGd9mLf83n5HbMn0y1zpXmfbLMvU1M=; b=IN6DysfsSOH3OQTdwfOFRWlc/zB/4F14lKgHrP1Uo7IE9XhVf52KKdtjmFnImOe4Uw NSkfvGDiJc+G07aVoHzO68m4xKceT+M9f7vVvdvhJXpdj98Tq2vpNqbHo5dmdw5MWnWL qVeGjab5a4VsX7GHfe4hYoDMLv003EZzU+qnT9uKbMWMJG3BzfyL+/5RVEKg/XobShAL ofH7S+uA8gW1mq99YBi56+Jlr+regkoCHMg5Zcnu3zacY+jT6hvwwSkE5256T5of6tQ2 yyRIALQvsoxeUJPSPFc4HI2diVPwav2xpBWjuabS37u3NZldqyF34Ome5h0tLpvWyYDQ pBuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=XtsFaoN9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id i16-20020a170902c95000b001c3b4cb8c88si579657pla.338.2023.10.30.23.20.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 23:20:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=XtsFaoN9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 8B8F9806B72C; Mon, 30 Oct 2023 23:20:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235998AbjJaGU1 (ORCPT + 99 others); Tue, 31 Oct 2023 02:20:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232876AbjJaGUY (ORCPT ); Tue, 31 Oct 2023 02:20:24 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8F23C9 for ; Mon, 30 Oct 2023 23:20:21 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-53d9f001b35so8498862a12.2 for ; Mon, 30 Oct 2023 23:20:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1698733220; x=1699338020; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=iDMKed0nzokCCbEBIpnlAR25vjS6WyJ1gGNxVZ8+dQM=; b=XtsFaoN9rWKi4F7Gg+wVu/NPKrXkorYOhaH05rrymdJiDuvWh13y0HdWphZ+hGx/GM VwJ5Lc5bkF7/2euchP1nlm6bncFgxsYZXm2p9b1hhLqzsFcgRTw1rrfpOGiKjyf5HtMf QqJPUTX61k1o8LpLMPRzdyWNWKW98gDodhZ20= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698733220; x=1699338020; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=iDMKed0nzokCCbEBIpnlAR25vjS6WyJ1gGNxVZ8+dQM=; b=KkSHa1QASw5YsG5MggX7havGObBD6iaHRIl6dqD9tGVcfwFnNn2SqomA2Ds9lkqk8j RkthevBMuRJOjEXzs962lGOPhuqQPyGFEkdtWWaJWLUNaimAsYqtZkoo7zA0+naaYEIr udgE8gBduqUrijdw3nVTmbspyIfGB9n1yAHmvWow4E4RrSREOElE9O46izYPHRns0N1p BPB/3POXnUOhXumKGYpebCJqdi/aeEIYo+218MFBjgnfAiAD0hWN7zs3kHw3j7eQOMeJ igw5T++8sTGqCzPvddDAOTJtGkUFoAU+I4v2N2HOnc/vfTb7Afi6iCttfs1xK02S6UDJ YXKQ== X-Gm-Message-State: AOJu0YzLhzipOuY5h/JpQxuOsek2oqs4HUaDVVL8c/EO0BfeqKq+9Vk3 fXvCiJUunFl3oilO1RJONbktbFW9cTpDV3jh9UEszy1l X-Received: by 2002:a17:907:9286:b0:9be:68db:b763 with SMTP id bw6-20020a170907928600b009be68dbb763mr9980629ejc.71.1698733220241; Mon, 30 Oct 2023 23:20:20 -0700 (PDT) Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com. [209.85.218.51]) by smtp.gmail.com with ESMTPSA id dv16-20020a170906b81000b00982a92a849asm398085ejb.91.2023.10.30.23.20.19 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Oct 2023 23:20:19 -0700 (PDT) Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-9d216597f64so385860066b.3 for ; Mon, 30 Oct 2023 23:20:19 -0700 (PDT) X-Received: by 2002:a17:907:6095:b0:9c7:54a1:9fe5 with SMTP id ht21-20020a170907609500b009c754a19fe5mr9489304ejc.49.1698733219178; Mon, 30 Oct 2023 23:20:19 -0700 (PDT) MIME-Version: 1.0 References: <20231031060524.1103921-1-hsiangkao@linux.alibaba.com> In-Reply-To: <20231031060524.1103921-1-hsiangkao@linux.alibaba.com> From: Linus Torvalds Date: Mon, 30 Oct 2023 20:20:01 -1000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] erofs: fix erofs_insert_workgroup() lockref usage To: Gao Xiang Cc: linux-erofs@lists.ozlabs.org, LKML Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Mon, 30 Oct 2023 23:20:35 -0700 (PDT) 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. Linus