]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/bluefs: Weaken locks in open_for_write
authorAdam Kupczyk <akupczyk@redhat.com>
Thu, 1 Jul 2021 09:33:20 +0000 (11:33 +0200)
committerIgor Fedotov <igor.fedotov@croit.io>
Tue, 27 Jun 2023 10:55:46 +0000 (13:55 +0300)
Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
(cherry picked from commit eac1807cf5f19dd79eb95bcb0cde80c67acb69f8)

src/os/bluestore/BlueFS.cc

index 50e6f38e7224722423334e7c73172a8d577f3c82..c37d95d056a79ced68313b7e3771fc500aabc2b7 100644 (file)
@@ -3516,7 +3516,7 @@ int BlueFS::open_for_write(
   FileWriter **h,
   bool overwrite)
 {
-  std::lock_guard nl(nodes.lock);
+  std::unique_lock nl(nodes.lock);
   dout(10) << __func__ << " " << dirname << "/" << filename << dendl;
   map<string,DirRef>::iterator p = nodes.dir_map.find(dirname);
   DirRef dir;
@@ -3578,6 +3578,7 @@ int BlueFS::open_for_write(
   dout(20) << __func__ << " mapping " << dirname << "/" << filename
           << " vsel_hint " << file->vselector_hint
           << dendl;
+  nl.unlock();
   {
     std::lock_guard ll(log.lock);
     log.t.op_file_update(file->fnode);