]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix no metadata sync for truncate 48169/head
authorIgor Fedotov <ifedotov@suse.com>
Tue, 12 Apr 2022 22:49:32 +0000 (01:49 +0300)
committerIgor Fedotov <igor.fedotov@croit.io>
Fri, 4 Aug 2023 15:49:25 +0000 (18:49 +0300)
Fixes: https://tracker.ceph.com/issues/55307
Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
(cherry picked from commit 73a7e92f0f6bfcfc3ebb94d1b767a044c2856f92)

src/os/bluestore/BlueFS.cc

index cf315e8033c9cf3f364bb6154d9a6fdb86bf1b16..d5a322cffa6d8872988761fd6420fd939dad18ca 100644 (file)
@@ -3660,6 +3660,7 @@ int BlueFS::truncate(FileWriter *h, uint64_t offset)/*_WF_L*/
   std::lock_guard ll(log.lock);
   vselector->sub_usage(h->file->vselector_hint, h->file->fnode.size);
   h->file->fnode.size = offset;
+  h->file->is_dirty = true;
   vselector->add_usage(h->file->vselector_hint, h->file->fnode.size);
   log.t.op_file_update_inc(h->file->fnode);
   return 0;
@@ -3671,7 +3672,8 @@ int BlueFS::fsync(FileWriter *h)/*_WF_WD_WLD_WLNF_WNF*/
   std::unique_lock hl(h->lock);
   uint64_t old_dirty_seq = 0;
   {
-    dout(10) << __func__ << " " << h << " " << h->file->fnode << dendl;
+    dout(10) << __func__ << " " << h << " " << h->file->fnode
+             << " dirty " << h->file->is_dirty << dendl;
     int r = _flush_F(h, true);
     if (r < 0)
       return r;