From: Ilya Dryomov Date: Fri, 10 Nov 2023 10:14:42 +0000 (+0100) Subject: librbd: resurrect "exists" assert in simple_diff_cb() X-Git-Tag: v19.1.0~638^2~5 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=bcb107afcd2b0e34b1eefa4767691c5d8d109a82;p=ceph.git librbd: resurrect "exists" assert in simple_diff_cb() This effectively reverts commit 3ccc3bb4bd35 ("librbd: diff_iterate needs to handle holes in parent images") which just dropped the assert instead of addressing the root cause of reported crashes. Signed-off-by: Ilya Dryomov --- diff --git a/src/librbd/api/DiffIterate.cc b/src/librbd/api/DiffIterate.cc index 1b6b3f72148dc..7679bf77759dc 100644 --- a/src/librbd/api/DiffIterate.cc +++ b/src/librbd/api/DiffIterate.cc @@ -150,11 +150,12 @@ private: }; int simple_diff_cb(uint64_t off, size_t len, int exists, void *arg) { - // it's possible for a discard to create a hole in the parent image -- ignore - if (exists) { - interval_set *diff = static_cast *>(arg); - diff->insert(off, len); - } + // This reads the existing extents in a parent from the beginning + // of time. Since images are thin-provisioned, the extents will + // always represent data, not holes. + ceph_assert(exists); + auto diff = static_cast*>(arg); + diff->insert(off, len); return 0; }