From: weixinwei Date: Sun, 4 Apr 2021 05:30:10 +0000 (+0800) Subject: os/bluestore/BlueFS: do not _flush_range deleted files X-Git-Tag: v17.1.0~2334^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F40581%2Fhead;p=ceph.git os/bluestore/BlueFS: do not _flush_range deleted files Fixes: https://tracker.ceph.com/issues/49861 Signed-off-by: weixinwei --- diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 86c7a53298010..8be431dfca085 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -2685,7 +2685,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); bool buffered;