]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix no metadata sync for truncate 45883/head
authorIgor Fedotov <ifedotov@suse.com>
Tue, 12 Apr 2022 22:49:32 +0000 (01:49 +0300)
committerIgor Fedotov <ifedotov@suse.com>
Fri, 12 Aug 2022 10:59:55 +0000 (13:59 +0300)
Fixes: https://tracker.ceph.com/issues/55307
Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
src/os/bluestore/BlueFS.cc

index 38cc5d54179b20c0d7fe03994e26b226a8470120..284906372c59b6dd6bbf60e560ca367916b66f1d 100644 (file)
@@ -3402,6 +3402,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;
@@ -3413,7 +3414,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;