From patchwork Thu Feb 9 06:39:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingbo Xu X-Patchwork-Id: 54743 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp171266wrn; Wed, 8 Feb 2023 22:42:47 -0800 (PST) X-Google-Smtp-Source: AK7set9n4PCPETujY4skzM5QQ/yytEO0m+VoXzxCUOvUD5K/h4fcQ91DydDq0fWLmu2hI0szse9K X-Received: by 2002:a17:90a:1c4:b0:22c:1920:27e5 with SMTP id 4-20020a17090a01c400b0022c192027e5mr4542611pjd.41.1675924967491; Wed, 08 Feb 2023 22:42:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675924967; cv=none; d=google.com; s=arc-20160816; b=Jsu1kB89b3mkIwEkvsqFt7x27alWCdgZg3YpxEMkZj3kp0Z7w7doJpb6RbS5N5FFw4 hs5c2wRuqjHwbjwpA2xc1ks+zzQef+T5RrcDS/anD9UUVM3uIQDblSyWdiC+PhCvdZ66 59R7RiP7+gjQA8lJgbiDif32t1A+Qo1MvQImkFxYw8gHMw6UR2ztU2EYhyexP0TmC7Db PAC3VneQi5In1ZU6EZlE+kITItbRv2qvNeDaur5BaXrET2xcImqu0ZUDe53tnX9b+Ess TvSHwzMoO3nwbkGv3Dlma8E1JX7LCh2ncuN2LEjQF4Yo7QhQmMavRDz3RoqBjrnRfEbk WBGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=I/6FSzp77Id8dq0EhG6/LthbDi8QUAWOGJ+Tiv9nvcE=; b=c6NCz+PziID9oE5prNWnsqbpunASebM2seIQD1L7THHHdK1MKFj0ow0qTBeRn00cF5 0fvQMWBPdv1GYg22CAORu71zgrU1Bhnhup3S4CaGja8KFp2kjvWQ2mEuA0ylLVNPJbcs 2G3hVdAoDCyGq2YAvrcAT313CjRGWP+nyf+l9stdIALCW4FKrUleu8++Kwcvbi2yb0wQ 9rakkpbcKoldvRtjZyGAkemdF36RVnHfGGguFeMGZDX7UJOTFol8EvFL1NL7f8j1NziI ctZc73qCjs78cbE8NLRZ1MTKSHO9iziuo3nZXF/nRF0TejOmnQBQWgR7mIz8YN8kI8jY eOrQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y30-20020a63b51e000000b004f1ab50b6fcsi1129729pge.109.2023.02.08.22.42.34; Wed, 08 Feb 2023 22:42:47 -0800 (PST) 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 S229789AbjBIGkN (ORCPT + 99 others); Thu, 9 Feb 2023 01:40:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229504AbjBIGkJ (ORCPT ); Thu, 9 Feb 2023 01:40:09 -0500 Received: from out30-100.freemail.mail.aliyun.com (out30-100.freemail.mail.aliyun.com [115.124.30.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD8253EFE0 for ; Wed, 8 Feb 2023 22:39:37 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0VbEsQkV_1675924756; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0VbEsQkV_1675924756) by smtp.aliyun-inc.com; Thu, 09 Feb 2023 14:39:16 +0800 From: Jingbo Xu To: xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org, zhujia.zj@bytedance.com Cc: huyue2@coolpad.com, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/4] erofs: relinquish volume with mutex held Date: Thu, 9 Feb 2023 14:39:12 +0800 Message-Id: <20230209063913.46341-4-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20230209063913.46341-1-jefflexu@linux.alibaba.com> References: <20230209063913.46341-1-jefflexu@linux.alibaba.com> MIME-Version: 1.0 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757334698801120995?= X-GMAIL-MSGID: =?utf-8?q?1757334698801120995?= Relinquish fscache volume with mutex held. Otherwise if a new domain is registered when the old domain with the same name gets removed from the list but not relinquished yet, fscache may complain the collision. Fixes: 8b7adf1dff3d ("erofs: introduce fscache-based domain") Signed-off-by: Jingbo Xu Reviewed-by: Jia Zhu --- fs/erofs/fscache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/erofs/fscache.c b/fs/erofs/fscache.c index a302d6d23ab5..c6f09928b62c 100644 --- a/fs/erofs/fscache.c +++ b/fs/erofs/fscache.c @@ -326,8 +326,8 @@ static void erofs_fscache_domain_put(struct erofs_domain *domain) kern_unmount(erofs_pseudo_mnt); erofs_pseudo_mnt = NULL; } - mutex_unlock(&erofs_domain_list_lock); fscache_relinquish_volume(domain->volume, NULL, false); + mutex_unlock(&erofs_domain_list_lock); kfree(domain->domain_id); kfree(domain); return;