From d24fbedd018b4b08ff0359e0f5ec5d08dad38e61 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 12 Aug 2010 16:08:16 -0700 Subject: [PATCH 1/2] Honor spa_config_path for ztest '-f' option The new spa_config_path string was lost from ztest_run_zdb() during the onnv_141 merge. This commit puts it back in place so the '-f' option is properly honored. Additionally this function had been tweaked so ztest could be run in-tree but that broke running it when installed as a package. I've updated that chunk to detect where it's running and try to do the right thing in both cases. Closes #49 --- cmd/ztest/ztest.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index adeeb25076..5f383e605b 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -4901,12 +4901,16 @@ ztest_run_zdb(char *pool) 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'; + if (strncmp(bin, "/usr/sbin/ztest", 14) == 0) { + strcpy(bin, "/usr/sbin/zdb"); /* Installed */ + } else { + strstr(bin, "/ztest/")[0] = '\0'; /* In-tree */ + strcat(bin, "/zdb/zdb"); + } (void) sprintf(zdb, - "%s/zdb/zdb -bcc%s%s -U /tmp/zpool.cache %s", + "%s -bcc%s%s -U %s %s", bin, zopt_verbose >= 3 ? "s" : "", zopt_verbose >= 4 ? "v" : "", From 9ae9e077fbdadca24d7818db83b9dd1a6ca1d81e Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 12 Aug 2010 16:33:21 -0700 Subject: [PATCH 2/2] Quiet two more large allocation warnings Both of these allocations are larger than 8k which trips the warning, but so no large that they must be vmem_alloc()'ed. For this case I have added the KM_NODEBUG flag which silences the warning. The flag also acts as a marker in the source so I can keep track of this as something which needs to be better addressed in the long term. SPL: large kmem_alloc(11876, 0x50) at get_nvlist:911 (341009/1877530) SPL: large kmem_alloc(11240, 0x50) at load_nvlist:1273 (2639492/2643588) Closes #50 --- module/zfs/spa.c | 2 +- module/zfs/zfs_ioctl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/zfs/spa.c b/module/zfs/spa.c index 0ca41faee5..ec99154a21 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -1265,7 +1265,7 @@ load_nvlist(spa_t *spa, uint64_t obj, nvlist_t **value) nvsize = *(uint64_t *)db->db_data; dmu_buf_rele(db, FTAG); - packed = kmem_alloc(nvsize, KM_SLEEP); + packed = kmem_alloc(nvsize, KM_SLEEP | KM_NODEBUG); error = dmu_read(spa->spa_meta_objset, obj, 0, nvsize, packed, DMU_READ_PREFETCH); if (error == 0) diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c index 68ac9fde51..26abf568e1 100644 --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@ -893,7 +893,7 @@ get_nvlist(uint64_t nvl, uint64_t size, int iflag, nvlist_t **nvp) if (size == 0) return (EINVAL); - packed = kmem_alloc(size, KM_SLEEP); + packed = kmem_alloc(size, KM_SLEEP | KM_NODEBUG); if ((error = ddi_copyin((void *)(uintptr_t)nvl, packed, size, iflag)) != 0) {