[PATCH v2 3/4] erofs: relinquish volume with mutex held

Jingbo Xu jefflexu at linux.alibaba.com
Thu Feb 9 16:18:37 AEDT 2023

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.

Signed-off-by: Jingbo Xu <jefflexu at linux.alibaba.com>
Reviewed-by: Jia Zhu <zhujia.zj at bytedance.com>
 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 2f5930e177cc..a6f030966147 100644
--- a/fs/erofs/fscache.c
+++ b/fs/erofs/fscache.c
@@ -328,8 +328,8 @@ static void erofs_fscache_domain_put(struct erofs_domain *domain)
 			erofs_pseudo_mnt = NULL;
-		mutex_unlock(&erofs_domain_list_lock);
 		fscache_relinquish_volume(domain->volume, NULL, false);
+		mutex_unlock(&erofs_domain_list_lock);

More information about the Linux-erofs mailing list