On Mon, Jul 1, 2019 at 7:34 AM Dongsheng Yang <dongsheng.yang@xxxxxxxxxxxx> wrote: > > Hi Ilya, > > On 06/25/2019 10:40 PM, Ilya Dryomov wrote: > > Hello, > > > > This series adds support for object-map and fast-diff image features. > > Patches 1 - 11 prepare object and image request state machines; patches > > 12 - 14 fix most of the shortcomings in our exclusive lock code, making > > it suitable for guarding the object map; patches 15 - 18 take care of > > the prerequisites and finally patches 19 - 20 implement object-map and > > fast-diff. > > Nice patchset. I did review and a testing for this patchset. Hi Dongsheng, Thank you! > > TEST: > with object-map enabled, I found a case failed: > tasks/rbd_kernel.yaml. > It failed to rollback test_img while test_img is mapped. This is because with object map reads grab the lock: 67 rbd resize testimg1 --size=40 --allow-shrink 68 cat /sys/bus/rbd/devices/$DEV_ID1/size | grep 41943040 69 cat /sys/bus/rbd/devices/$DEV_ID2/size | grep 76800000 70 71 sudo dd if=/dev/rbd/rbd/testimg1 of=/tmp/img1.small 72 cp /tmp/img1 /tmp/img1.trunc 73 truncate -s 41943040 /tmp/img1.trunc 74 cmp /tmp/img1.trunc /tmp/img1.small 75 76 # rollback and check data again 77 rbd snap rollback --snap=snap1 testimg1 Without object map the lock is freed by resize on line 67 and rollback executes on an unlocked image. With object map we re-grab the lock for dd on line 71 and rollback executes on a locked image. rollback isn't supposed to work on a locked image, so it's just an accident that this test continued to work after exclusive lock was introduced in 4.9. Another test that will need to be fixed is krbd_exclusive_option.sh. This one fails both with and without object-map feature because we no longer block if the peer refuses to release the lock. I'm on vacation and didn't get a chance to update the test suite yet. Ilya