From: Ilya Dryomov Date: Fri, 2 May 2014 11:13:11 +0000 (+0400) Subject: test_librbd_fsx: fix a bug in docloseopen() X-Git-Tag: v0.81~48^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c4a764cc80ad34b637fe03577268884f13d3ce03;p=ceph.git test_librbd_fsx: fix a bug in docloseopen() docloseopen() always opens $iname image. This is bad, because the image we had opened could have been something like $iname-clone3. Fix it by leveraging the fact that rbd_ctx has an image name field. Signed-off-by: Ilya Dryomov --- diff --git a/src/test/librbd/fsx.c b/src/test/librbd/fsx.c index f3291c1a7bc..3cefbc5a1a6 100644 --- a/src/test/librbd/fsx.c +++ b/src/test/librbd/fsx.c @@ -1449,11 +1449,14 @@ do_flatten() void docloseopen(void) { + char *name; int ret; if (testcalls <= simulatedopcount) return; + name = strdup(ctx.name); + if (debug) prt("%lu close/open\n", testcalls); @@ -1463,11 +1466,13 @@ docloseopen(void) report_failure(180); } - ret = ops->open(iname, &ctx); + ret = ops->open(name, &ctx); if (ret < 0) { prterrcode("docloseopen: ops->open", ret); report_failure(181); } + + free(name); } #define TRIM_OFF_LEN(off, len, size) \