From aa4bd67746b05d1c2d3b79f6c61b9442296fdf7f Mon Sep 17 00:00:00 2001 From: mav Date: Fri, 14 Oct 2016 07:20:49 +0000 Subject: [PATCH] MFC r305326: MFV r303079: 7147 ztest: ztest_ddt_repair fails with ztest_pattern_match assertion illumos/illumos-gate@aab80726335c76a7cae32c7300890248d73a51e3 https://github.com/illumos/illumos-gate/commit/aab80726335c76a7cae32c7300890248d 73a51e3 https://www.illumos.org/issues/7147 Here's the dbuf we're currently reading: 966f200::dbuf addr object lvl blkid holds os 966f200 4 0 0 1 ztest/ds_3 966f200::print dmu_buf_t db_data db_data = 0x9ae0400 0x9ae0400/10J 0x9ae0400: c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d The pattern we're expecting is actually this: a34ae10b5f2db2. If we attempt to read the block on disk we find that it has matches what ztest_ddt_repair() would have written: ~c1c7ced932020d=J ff3e383126cdfdf2 966f200::print dmu_buf_impl_t db_blkptr | ::blkptr DVA0=<0:71d3c00:800> [L0 UINT64_OTHER] SHA256 OFF LE contiguous dedup single size=400L/400P birth=55L/55P fill=1 cksum=18486450d3ce8c6d:75a72f4bbf117b0f:2d3a226314eb5650:2eb0fd68648b1af0 1. zdb -U /rpool/tmp/zpool.cache -R ztest 0:71d3c00:800 | head Found vdev type: mirror 0:71d3c00:800 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef 000000: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>. 000010: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>. 000020: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>. 000030: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>. 000040: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>. 000050: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>. Reviewed by: Matthew Ahrens Reviewed by: Prakash Surya Approved by: Robert Mustacchi Author: George Wilson git-svn-id: svn://svn.freebsd.org/base/stable/10@307272 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- cddl/contrib/opensolaris/cmd/ztest/ztest.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/ztest/ztest.c b/cddl/contrib/opensolaris/cmd/ztest/ztest.c index 488e1fde9..05edd64a2 100644 --- a/cddl/contrib/opensolaris/cmd/ztest/ztest.c +++ b/cddl/contrib/opensolaris/cmd/ztest/ztest.c @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. @@ -5022,9 +5022,14 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_t id) return; } + dmu_objset_stats_t dds; + dsl_pool_config_enter(dmu_objset_pool(os), FTAG); + dmu_objset_fast_stat(os, &dds); + dsl_pool_config_exit(dmu_objset_pool(os), FTAG); + object = od[0].od_object; blocksize = od[0].od_blocksize; - pattern = zs->zs_guid ^ dmu_objset_fsid_guid(os); + pattern = zs->zs_guid ^ dds.dds_guid; ASSERT(object != 0); @@ -5627,9 +5632,13 @@ ztest_run(ztest_shared_t *zs) metaslab_preload_limit = ztest_random(20) + 1; ztest_spa = spa; + dmu_objset_stats_t dds; VERIFY0(dmu_objset_own(ztest_opts.zo_pool, DMU_OST_ANY, B_TRUE, FTAG, &os)); - zs->zs_guid = dmu_objset_fsid_guid(os); + dsl_pool_config_enter(dmu_objset_pool(os), FTAG); + dmu_objset_fast_stat(os, &dds); + dsl_pool_config_exit(dmu_objset_pool(os), FTAG); + zs->zs_guid = dds.dds_guid; dmu_objset_disown(os, FTAG); spa->spa_dedup_ditto = 2 * ZIO_DEDUPDITTO_MIN; -- 2.45.0