From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A3AEBA45 for ; Tue, 7 Mar 2023 18:03:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F4134C433D2; Tue, 7 Mar 2023 18:03:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678212191; bh=s11hswL2oJ7Z+VbMcKZPSGudY23IvsWh97b9d22EjRs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ChQVgS67ok+DeXdwZlc8gwd92GN7vNzPHCFEthCqsewuXi3MPy4E6uFCBQw74wsFI 7gGW3J+jEGyczqLKy+rmq55siIujyYU0Ta4YRewdwzX+p5dPGcGBEjNAwY6h4/BU1t Z0y0k21atGU2QmiLk6jLvBXPFd7Eg6OTXMa6Ul2w= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jingbo Xu , Jia Zhu , Gao Xiang , Sasha Levin Subject: [PATCH 6.1 106/885] erofs: relinquish volume with mutex held Date: Tue, 7 Mar 2023 17:50:40 +0100 Message-Id: <20230307170006.489732629@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307170001.594919529@linuxfoundation.org> References: <20230307170001.594919529@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Jingbo Xu [ Upstream commit 7032809a44d752b9e2275833787e0aa88a7540af ] 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 Link: https://lore.kernel.org/r/20230209063913.46341-4-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang Signed-off-by: Sasha Levin --- 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 b04f93bc062a8..076cf8a149ef3 100644 --- a/fs/erofs/fscache.c +++ b/fs/erofs/fscache.c @@ -398,8 +398,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; -- 2.39.2