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: v17.2.8~615^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9f1b4008de0705f187dc1d2a09f80cd1f4937a30;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 (cherry picked from commit bcb107afcd2b0e34b1eefa4767691c5d8d109a82) --- diff --git a/src/librbd/api/DiffIterate.cc b/src/librbd/api/DiffIterate.cc index d8760692e1cb..6c86f56b3eea 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; }