Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1605101rwn; Thu, 15 Sep 2022 19:53:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7mGe5v0q1xNvGaxAlHUCdyShlCuDGglZfcGYbLusdSWbxv6luzI9KiwLObHSyEOlLdxapL X-Received: by 2002:aa7:888d:0:b0:538:328b:2ffb with SMTP id z13-20020aa7888d000000b00538328b2ffbmr2568761pfe.82.1663296780895; Thu, 15 Sep 2022 19:53:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663296780; cv=none; d=google.com; s=arc-20160816; b=DnzCe27qJtydSCgXA90ie2gcHNdKIVKtvS6LyLdnsGPLJJlSiWRfGp6c0rnq/kWURI vS6t8Z1AaEUy7sOjVZBODgafRdO0i42x3AJFcLanFm8VFh+VlPHzRu9BGZlGr/gHb5Ys 3ix+g2KNS24VkDXZKUqVy6oUAoHEmW8YRHzGUku40ShkKcAVzVtOLvMxI3I1bP6d3mqe e/YmYUiPzbKxe3Wcp4GN/hcWPJsYSGyhrgSgwls2oaFYVbSIw1JTiPBjlGdvurUdJgoH 030tMDja7EkDJdKA9F2f8I4LrU/kvTiWNS/c6eqFfH4r72hcpQMeFmfbtmpOzb3+XxDX G80A== 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=720iu7iqsBaCnYGrDyrSw7usEJgX+6dXh7uxvQ3HJ1k=; b=JgzLgoLgHxnqHyrgkv4wfi6fAQu79VmTOqiKuk2w8f1/e9MoEckUoUJdQPJsMCRlXv 2ZPLXjObR6vvBJ6MZUWaQ2TbBciejiXID1U5xyDf793e+/5DgLI9I8tmvRHIcNmFEMcy 69r34cA5VzYdG9rE95WTId1MsXXwQzxhkfHX+3wFOKbfvwuxP5cq7rzXOkS4CgWykxiE t4P9WTqsetAPEyMeuObS4tSnE4Uej42NaiHW7YGhbPUcMrwZ4ewYDlowO3OkUYjRf7Aa 2tHEl3hZhiBcEoAV6ZvbPZq5877Cw7jsvVWqvTYsCoWErPCiMHwvVmotfcEnLs56nmsP ICOQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y27-20020a056a00181b00b0053aa6311dc4si21522249pfa.19.2022.09.15.19.52.49; Thu, 15 Sep 2022 19:53:00 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229952AbiIPCgB (ORCPT + 99 others); Thu, 15 Sep 2022 22:36:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbiIPCf7 (ORCPT ); Thu, 15 Sep 2022 22:35:59 -0400 Received: from out30-45.freemail.mail.aliyun.com (out30-45.freemail.mail.aliyun.com [115.124.30.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F2806D9D1; Thu, 15 Sep 2022 19:35:58 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045168;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0VPv3AqH_1663295754; Received: from 30.221.130.67(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0VPv3AqH_1663295754) by smtp.aliyun-inc.com; Fri, 16 Sep 2022 10:35:55 +0800 Message-ID: <96a96aff-5d16-a2e3-2529-58e154e0f728@linux.alibaba.com> Date: Fri, 16 Sep 2022 10:35:54 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH V4 3/6] erofs: introduce fscache-based domain Content-Language: en-US To: Jia Zhu , linux-erofs@lists.ozlabs.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, yinxin.x@bytedance.com References: <20220915124213.25767-1-zhujia.zj@bytedance.com> <20220915124213.25767-4-zhujia.zj@bytedance.com> From: JeffleXu In-Reply-To: <20220915124213.25767-4-zhujia.zj@bytedance.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL 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 9/15/22 8:42 PM, Jia Zhu wrote: > > +static void erofs_fscache_domain_put(struct erofs_domain *domain) > +{ > + if (!domain) > + return; > + mutex_lock(&erofs_domain_list_lock); > + if (refcount_dec_and_test(&domain->ref)) { > + list_del(&domain->list); > + fscache_relinquish_volume(domain->volume, NULL, false); > + mutex_unlock(&erofs_domain_list_lock); I think we can mutex_unlock as long as the domain is removed from the list. Otherwise LGTM. Reviewed-by: Jingbo Xu -- Thanks, Jingbo