From: Ilya Dryomov Date: Thu, 1 Mar 2018 16:01:11 +0000 (+0100) Subject: qa: krbd huge-image test X-Git-Tag: v13.0.2~105^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6828641e72e746996d03fb3c0fcddcff25b352b3;p=ceph.git qa: krbd huge-image test We've had multiple overflows in ceph_calc_file_object_mapping(). It wasn't being used by rbd, but it now is. Signed-off-by: Ilya Dryomov --- diff --git a/qa/rbd/krbd_huge_image.t b/qa/rbd/krbd_huge_image.t new file mode 100644 index 000000000000..1e58b483c633 --- /dev/null +++ b/qa/rbd/krbd_huge_image.t @@ -0,0 +1,41 @@ + + $ get_field() { + > rbd info --format=json $1 | python -c "import sys, json; print json.load(sys.stdin)['$2']" + > } + +Write to first and last sectors and make sure we hit the right objects: + + $ ceph osd pool create hugeimg 12 >/dev/null 2>&1 + $ rbd pool init hugeimg + $ rbd create --size 4E --object-size 4K --image-feature layering hugeimg/img + $ DEV=$(sudo rbd map hugeimg/img) + $ xfs_io -c 'pwrite 0 512' $DEV >/dev/null # first sector + $ xfs_io -c 'pwrite 4611686018427387392 512' $DEV >/dev/null # last sector + $ sudo rbd unmap $DEV + + $ get_field hugeimg/img size + 4611686018427387904 + $ get_field hugeimg/img objects + 1125899906842624 + $ rados -p hugeimg ls | grep $(get_field hugeimg/img block_name_prefix) | sort + .*\.0000000000000000 (re) + .*\.0003ffffffffffff (re) + +Dump first and last megabytes: + + $ DEV=$(sudo rbd map hugeimg/img) + $ hexdump -n 1048576 $DEV + 0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd + * + 0000200 0000 0000 0000 0000 0000 0000 0000 0000 + * + 0100000 + $ hexdump -s 4611686018426339328 $DEV + 3ffffffffff00000 0000 0000 0000 0000 0000 0000 0000 0000 + * + 3ffffffffffffe00 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd + * + 4000000000000000 + $ sudo rbd unmap $DEV + + $ ceph osd pool delete hugeimg hugeimg --yes-i-really-really-mean-it >/dev/null 2>&1 diff --git a/qa/suites/krbd/basic/tasks/krbd_huge_image.yaml b/qa/suites/krbd/basic/tasks/krbd_huge_image.yaml new file mode 100644 index 000000000000..5fe7af04449b --- /dev/null +++ b/qa/suites/krbd/basic/tasks/krbd_huge_image.yaml @@ -0,0 +1,5 @@ +tasks: +- cram: + clients: + client.0: + - http://git.ceph.com/?p={repo};a=blob_plain;hb={branch};f=qa/rbd/krbd_huge_image.t