mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jingbo Xu <jefflexu@linux.alibaba.com>
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] erofs: relinquish volume with mutex held
Date: Wed,  8 Feb 2023 15:32:06 +0800	[thread overview]
Message-ID: <20230208073206.111814-1-jefflexu@linux.alibaba.com> (raw)
In-Reply-To: <cover.1675840368.git.jefflexu@linux.alibaba.com>

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@linux.alibaba.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 8da6e05e9d23..35b2d8b5773e 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)
 			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.19.1.6.gb485710b


  parent reply	other threads:[~2023-02-08  7:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-08  7:15 [PATCH 0/4] erofs: cleanup for fscache share domain mode Jingbo Xu
2023-02-08  7:16 ` [PATCH 1/4] erofs: remove unused device mapping in meta routine Jingbo Xu
2023-02-08  7:21   ` [External] " Jia Zhu
2023-02-08  7:16 ` [PATCH 2/4] erofs: maintain cookies of share domain in self-contained list Jingbo Xu
2023-02-08  8:16   ` [External] " Jia Zhu
2023-02-08  7:16 ` [PATCH 3/4] erofs: unify anonymous inodes for blob Jingbo Xu
2023-02-08  9:01   ` [External] " Jia Zhu
2023-02-08  7:17 ` [PATCH 4/4] erofs: simplify the name collision checking in share domain mode Jingbo Xu
2023-02-09  2:43   ` Jia Zhu
2023-02-09  5:01   ` Jingbo Xu
2023-02-08  7:32 ` Jingbo Xu [this message]
2023-02-08  9:09   ` [External] [PATCH] erofs: relinquish volume with mutex held Jia Zhu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230208073206.111814-1-jefflexu@linux.alibaba.com \
    --to=jefflexu@linux.alibaba.com \
    --cc=chao@kernel.org \
    --cc=huyue2@coolpad.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xiang@kernel.org \
    --cc=zhujia.zj@bytedance.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®