From 745e5744663a2e68889ed70c5bce73d3a8ef1132 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Fri, 1 Feb 2019 10:35:33 +0100 Subject: [PATCH] qa: update krbd tests for zeroout Discard no longer guarantees zeroing, use BLKZEROOUT and "fallocate -z" instead (blkdiscard(8) in xenial doesn't support -z). Signed-off-by: Ilya Dryomov (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 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/test/librbd/fsx.cc b/src/test/librbd/fsx.cc index baa1a21ea6207..00c6847162c23 100644 --- a/src/test/librbd/fsx.cc +++ b/src/test/librbd/fsx.cc @@ -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; } -- 2.39.5