Actions
Bug #53897
closeddiff-iterate can report holes when diffing against the beginning of time (fromsnapname == NULL)
% Done:
0%
Source:
Tags:
backport_processed
Backport:
pacific,quincy,reef
Regression:
No
Severity:
3 - minor
Reviewed:
Description
rbd_diff_iterate/rbd_diff_iterate2() API documentation says:
If the source snapshot name is NULL, we interpret that as the beginning of time and return all allocated regions of the image.
Based on this sentence, the user can rightfully assume that the callback would only be invoked for allocated areas (i.e. with exists=true). However, if there is a snapshot which contains a discarded object, diff-iterate reports holes (exists=false) even when diffing against the beginning of time:
$ rbd create --size 16M foo $ sudo rbd map foo /dev/rbd0 $ sudo xfs_io -d -c 'pwrite -b 4M 0 16M' /dev/rbd0 wrote 16777216/16777216 bytes at offset 0 16 MiB, 4 ops; 0.4607 sec (34.726 MiB/sec and 8.6814 ops/sec) $ rbd snap create foo@snap Creating snap: 100% complete...done. $ rbd diff foo Offset Length Type 0 4194304 data 4194304 4194304 data 8388608 4194304 data 12582912 4194304 data $ blkdiscard -o 4M -l 8M /dev/rbd0 $ rbd diff foo Offset Length Type 0 4194304 data 4194304 4194304 zero 8388608 4194304 zero 12582912 4194304 data
Removing such a snapshot makes these "holes" disappear from the report:
$ rbd snap rm foo@snap Removing snap: 100% complete...done. $ rbd diff foo Offset Length Type 0 4194304 data 12582912 4194304 data
If nothing depends on this quirk, it should be fixed. Otherwise, the documentation needs to be updated to mention this.
Actions