From 28a78fa1690ce43bd225de79b7a229b739b02bdd Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Thu, 17 Aug 2023 06:12:00 +0000 Subject: [PATCH] test/librbd/fsx: fix wnbd check When using WNBD, the IO size must be a multiple of the sector size (WNBD only supports 512 at the moment). We're currently checking the "wnbd_operations" variable, however it's only defined on Windows, leading to a compilation failure on other platforms. We'll switch back to a separate boolean variable called "wnbd_disk". Fixes: https://tracker.ceph.com/issues/62475 Signed-off-by: Lucian Petrut --- src/test/librbd/fsx.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/test/librbd/fsx.cc b/src/test/librbd/fsx.cc index a727bde1ce488..acea8ede27087 100644 --- a/src/test/librbd/fsx.cc +++ b/src/test/librbd/fsx.cc @@ -209,6 +209,8 @@ FILE * fsxlogf = NULL; int badoff = -1; int closeopen = 0; +bool wnbd_disk = false; + void vwarnc(int code, const char *fmt, va_list ap) { fprintf(stderr, "fsx: "); @@ -2269,7 +2271,7 @@ doread(unsigned offset, unsigned size) int ret; offset -= offset % readbdy; - if (o_direct || ops == &wnbd_operations) + if (o_direct || wnbd_disk) size -= size % readbdy; if (size == 0) { if (!quiet && testcalls > simulatedopcount && !o_direct) @@ -2359,7 +2361,7 @@ dowrite(unsigned offset, unsigned size) off_t newsize; offset -= offset % writebdy; - if (o_direct || ops == &wnbd_operations) + if (o_direct || wnbd_disk) size -= size % writebdy; if (size == 0) { if (!quiet && testcalls > simulatedopcount && !o_direct) @@ -3457,6 +3459,7 @@ main(int argc, char **argv) case 'M': prt("rbd-wnbd mode enabled\n"); ops = &wnbd_operations; + wnbd_disk = true; break; #endif case 'L': -- 2.39.5