Project

General

Profile

Bug #39455

Updated by Nathan Cutler about 5 years ago

While working on #39447 I was surprised to find that "rbd diff" reports a diff in the following case: 

 Starting from a freshly deployed nautilus cluster: 

 <pre> 
 ceph osd pool create rbd 30 30 replicated 
 dd if=/bin/sh of=/tmp/img1 bs=1k count=1 seek=10 
 dd if=/bin/dd of=/tmp/img1 bs=1k count=10 seek=100 
 dd if=/bin/rm of=/tmp/img1 bs=1k count=100 seek=1000 
 dd if=/bin/ls of=/tmp/img1 bs=1k seek=10000 
 dd if=/bin/ln of=/tmp/img1 bs=1k seek=100000 
 rbd import /tmp/img1 testimg1 
 rbd diff testimg1 
 </pre> 

 The last command produces the following output: 

 <pre> 
 # rbd diff testimg1 
 Offset      Length    Type  
 0           1089536 data  
 8388608     1986560 data  
 100663296 1805336 data  
 </pre> 

 My expectation based on reading the rbd manpage ("diff - Dump ("Dump a list of byte extents in the image that have changed since the specified start snapshot, or since the image was created") would be that the command would *not* produce any output (i.e., no diff). 

 If I then make a snapshot and diff against the snapshot, the behavior is as expected: 

 <pre> 
 # rbd snap create testimg1 --snap=snap1 
 # rbd diff --from-snap=snap1 testimg1  
 # 
 </pre>

Back