]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: update krbd tests for zeroout 26286/head
authorIlya Dryomov <idryomov@gmail.com>
Fri, 1 Feb 2019 09:35:33 +0000 (10:35 +0100)
committerNathan Cutler <ncutler@suse.com>
Tue, 5 Feb 2019 17:00:15 +0000 (18:00 +0100)
Discard no longer guarantees zeroing, use BLKZEROOUT and "fallocate -z"
instead (blkdiscard(8) in xenial doesn't support -z).

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 04f5b343f9987f0cf67509c2a76ddf7ef46288e5)

Conflicts:
qa/rbd/krbd_whole_object_zeroout.t
qa/suites/krbd/basic/tasks/krbd_whole_object_zeroout.yaml
- the modifications to these files are not relevant for luminous

src/test/librbd/fsx.cc

index baa1a21ea620733784d7db490170a4449b4bf0b1..00c6847162c2358e5c06714d4182848c4fe5d54b 100644 (file)
@@ -963,7 +963,7 @@ krbd_discard(struct rbd_ctx *ctx, uint64_t off, uint64_t len)
        int ret;
 
        /*
-        * BLKDISCARD goes straight to disk and doesn't do anything
+        * BLKZEROOUT goes straight to disk and doesn't do anything
         * about dirty buffers.  This means we need to flush so that
         *
         *   write 0..3M
@@ -977,19 +977,22 @@ krbd_discard(struct rbd_ctx *ctx, uint64_t off, uint64_t len)
         *
         * returns "data 0000 data" rather than "data data data" in
         * case 1..2M was cached.
+        *
+         * Note: These cache coherency issues are supposed to be fixed
+         * in recent kernels.
         */
        ret = __krbd_flush(ctx, true);
        if (ret < 0)
                return ret;
 
        /*
-        * off and len must be 512-byte aligned, otherwise BLKDISCARD
+        * off and len must be 512-byte aligned, otherwise BLKZEROOUT
         * will fail with -EINVAL.  This means that -K (enable krbd
         * mode) requires -h 512 or similar.
         */
-       if (ioctl(ctx->krbd_fd, BLKDISCARD, &range) < 0) {
+       if (ioctl(ctx->krbd_fd, BLKZEROOUT, &range) < 0) {
                ret = -errno;
-               prt("BLKDISCARD(%llu, %llu) failed\n", off, len);
+               prt("BLKZEROOUT(%llu, %llu) failed\n", off, len);
                return ret;
        }