]> git.apps.os.sepia.ceph.com Git - ceph-ci.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:34:31 +0000 (12:34 +0200)
commit05486fe6bb2fb353d30993e575ec2c21f96e43cb
tree7bf3c650ebf25c127c21660481894abe13d72c20
parent7ebba9fcb121e844369f5bf8d1fc6b0ec0847654
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