]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Fix zdb segfault
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 23 Oct 2014 22:26:49 +0000 (15:26 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 23 Oct 2014 22:30:32 +0000 (15:30 -0700)
On 32-bit systems setting 'zfs_arc_max = 256M' in zdb results in the
following segmentation fault.  Rather than reverting 0ec0724 which
introduced this flaw this code is only used for 64-bit builds.

Segmentation fault (core dumped)
ztest: '/sbin/zdb -bcc -d -U /var/tmp/zpool.cache ztest' exit code 139
child exited with code 3

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
cmd/zdb/zdb.c

index 205f65577946b61205f83bde2cf28fbefb7050e4..b0d7170b92b26b28786492ca97ba3e30f51caf5a 100644 (file)
@@ -3522,11 +3522,13 @@ main(int argc, char **argv)
                usage();
        }
 
+#if defined(_LP64)
        /*
         * ZDB does not typically re-read blocks; therefore limit the ARC
         * to 256 MB, which can be used entirely for metadata.
         */
        zfs_arc_max = zfs_arc_meta_limit = 256 * 1024 * 1024;
+#endif
 
        kernel_init(FREAD);
        if ((g_zfs = libzfs_init()) == NULL)