Bug #63770
Updated by Ilya Dryomov 5 months ago
On an image without fast-diff feature:
<pre>
$ rbd create -s 1G --image-shared foo
$ sudo rbd device map foo
/dev/rbd0
$ sudo xfs_io -d -c 'pwrite 0 2M' /dev/rbd0
$ rbd snap create foo@snap
Creating snap: 100% complete...done.
$ sudo blkdiscard -o 1M -l 2M /dev/rbd0
$ sudo rbd device unmap /dev/rbd0
</pre>
Running a diff from the beginning of time to HEAD:
<pre>
$ rbd diff foo
Offset Length Type
0 2097152 data
</pre>
0~1M extent is expected instead of 0~2M extent, because the size of the object in question is 1M:
<pre>
$ rbd info foo | grep block_name_prefix
block_name_prefix: rbd_data.81db3b85b87e
$ rados -p rbd stat rbd_data.81db3b85b87e.0000000000000000
rbd/rbd_data.81db3b85b87e.0000000000000000 mtime 2023-12-08T12:26:57.000000+0100, size 1048576
</pre>
This appears to be yet another bug in calc_snap_set_diff().