]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/BlueFS: do not _flush_range deleted files 40793/head
authorweixinwei <weixw3@lenovo.com>
Sun, 4 Apr 2021 05:30:10 +0000 (13:30 +0800)
committerNathan Cutler <ncutler@suse.com>
Sun, 11 Apr 2021 10:17:05 +0000 (12:17 +0200)
Fixes: https://tracker.ceph.com/issues/49861
Signed-off-by: weixinwei <weixw3@lenovo.com>
(cherry picked from commit 744bd5271cfcd2d84bc908a1893bbdfd51d2f8f0)

src/os/bluestore/BlueFS.cc

index 080a0f14b83985862352a6f261a4f76c8650368a..03cc9c5fe868c3c7aa1780570a8fbc1ff4decff1 100644 (file)
@@ -2846,7 +2846,11 @@ int BlueFS::_flush_range(FileWriter *h, uint64_t offset, uint64_t length)
   dout(10) << __func__ << " " << h << " pos 0x" << std::hex << h->pos
           << " 0x" << offset << "~" << length << std::dec
           << " to " << h->file->fnode << dendl;
-  ceph_assert(!h->file->deleted);
+  if (h->file->deleted) {
+    dout(10) << __func__ << "  deleted, no-op" << dendl;
+    return 0;
+  }
+
   ceph_assert(h->file->num_readers.load() == 0);
 
   h->buffer_appender.flush();