]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: Added check against using out-of-range extent
authorAdam Kupczyk <akupczyk@redhat.com>
Mon, 8 Jun 2020 10:36:00 +0000 (12:36 +0200)
committerNathan Cutler <ncutler@suse.com>
Thu, 13 Aug 2020 19:42:25 +0000 (21:42 +0200)
This partially fixes https://tracker.ceph.com/issues/45903

Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
(cherry picked from commit 340917d409012d8a8530c9050b79b875e87dc029)

Conflicts:
src/os/bluestore/BlueFS.cc
- commits are being backported to octopus in the wrong order
  (40e94a106a8adff6304905d59e1634801d2c9890 has already been backported,
  yet this commit went into master before it)

src/os/bluestore/BlueFS.cc

index b3dc9360981605f993d45882c9dc418486503c3f..7b42f2f0c738463461bd86a97fe3a6b3114600f7 100644 (file)
@@ -1915,6 +1915,7 @@ int BlueFS::_read_random(
       s_lock.unlock();
       uint64_t x_off = 0;
       auto p = h->file->fnode.seek(off, &x_off);
+      ceph_assert(p != h->file->fnode.extents.end());
       uint64_t l = std::min(p->length - x_off, len);
       dout(20) << __func__ << " read random 0x"
               << std::hex << x_off << "~" << l << std::dec