]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd: diff-iterate shouldn't crash on an empty byte range
authorIlya Dryomov <idryomov@gmail.com>
Tue, 11 Jun 2024 16:10:47 +0000 (18:10 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Sun, 23 Jun 2024 10:32:23 +0000 (12:32 +0200)
commitc2b2ba572aa94a27fbecbe25fd16345c92a5879e
tree28be8d59b58578a6f80801a3d3566b8d26185688
parent9275d50252d114e303101b31c1d9ea8be9b5f8b4
librbd: diff-iterate shouldn't crash on an empty byte range

Commit 0b5ba5fedf70 ("librbd/object_map: add support for ranged
diff-iterate") introduced a regression for the case when whole_object
parameter is set to true.  Despite DiffRequest being called into and
another DiffIterate potentially being spawned recursively, an empty
byte range previously happened to make it.

Bail on an empty byte range early just like we have always done on an
empty snap id range (i.e. when start and end versions are the same).

Fixes: https://tracker.ceph.com/issues/66418
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit a3441a701963fef155fdda7d8f949d73bae26b69)
src/librbd/api/DiffIterate.cc
src/test/librbd/test_librbd.cc