Merge pull request #29966 from idryomov/wip-krbd-zero-after-overlap

qa: krbd_parent_overlap.t: fix read test

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
This commit is contained in:
Ilya Dryomov 2019-08-28 20:34:04 +02:00 committed by GitHub
commit 918fd28f88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,22 +1,27 @@
For reads, only the object extent needs to be reverse mapped: For reads, only the object extent needs to be reverse mapped:
$ rbd create --size 20M img $ rbd create --size 5M img
$ DEV=$(sudo rbd map img) $ DEV=$(sudo rbd map img)
$ xfs_io -c 'pwrite 0 20M' $DEV >/dev/null $ xfs_io -c 'pwrite 0 5M' $DEV >/dev/null
$ sudo rbd unmap $DEV $ sudo rbd unmap $DEV
$ rbd snap create img@snap $ rbd snap create img@snap
$ rbd snap protect img@snap $ rbd snap protect img@snap
$ rbd clone img@snap cloneimg $ rbd clone img@snap cloneimg
$ rbd resize --no-progress --size 5M --allow-shrink cloneimg $ rbd resize --no-progress --size 12M cloneimg
$ rbd resize --no-progress --size 20M cloneimg
$ DEV=$(sudo rbd map cloneimg) $ DEV=$(sudo rbd map cloneimg)
$ hexdump $DEV $ hexdump $DEV
0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd 0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
* *
0500000 0000 0000 0000 0000 0000 0000 0000 0000 0500000 0000 0000 0000 0000 0000 0000 0000 0000
* *
1400000 0c00000
$ dd if=$DEV iflag=direct bs=4M status=none | hexdump
0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
*
0500000 0000 0000 0000 0000 0000 0000 0000 0000
*
0c00000
$ sudo rbd unmap $DEV $ sudo rbd unmap $DEV
$ rbd rm --no-progress cloneimg $ rbd rm --no-progress cloneimg
$ rbd snap unprotect img@snap $ rbd snap unprotect img@snap