diff --git a/.topmsg b/.topmsg index b607aee225..b32b4eda48 100644 --- a/.topmsg +++ b/.topmsg @@ -1,6 +1,8 @@ From: Brian Behlendorf Subject: [PATCH] linux ztest -Minor changes to ztest for this environment. +Minor changes to ztest for this environment. These including +updating ztest to run in the local development tree, as well +as relocating some local variables in this function to the heap. Signed-off-by: Brian Behlendorf diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index e481be066d..e12b326359 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -4820,11 +4820,15 @@ static void ztest_run_zdb(char *pool) { int status; - char bin[MAXPATHLEN + MAXNAMELEN + 20]; - char zdb[MAXPATHLEN + MAXNAMELEN + 20]; - char zbuf[1024]; + char *bin; + char *zdb; + char *zbuf; FILE *fp; + bin = umem_alloc(MAXPATHLEN + MAXNAMELEN + 20, UMEM_NOFAIL); + zdb = umem_alloc(MAXPATHLEN + MAXNAMELEN + 20, UMEM_NOFAIL); + zbuf = umem_alloc(1024, UMEM_NOFAIL); + /* Designed to be run exclusively in the development tree */ VERIFY(realpath(getexecname(), bin) != NULL); strstr(bin, "/ztest/")[0] = '\0'; @@ -4849,13 +4853,17 @@ ztest_run_zdb(char *pool) status = pclose(fp); if (status == 0) - return; + goto out; ztest_dump_core = 0; if (WIFEXITED(status)) fatal(0, "'%s' exit code %d", zdb, WEXITSTATUS(status)); else fatal(0, "'%s' died with signal %d", zdb, WTERMSIG(status)); +out: + umem_free(bin, MAXPATHLEN + MAXNAMELEN + 20); + umem_free(zdb, MAXPATHLEN + MAXNAMELEN + 20); + umem_free(zbuf, 1024); } static void