Author: mav
Date: Fri Oct 14 07:20:07 2016
New Revision: 307271
URL: https://svnweb.freebsd.org/changeset/base/307271

Log:
  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 <mahr...@delphix.com>
  Reviewed by: Prakash Surya <prakash.su...@delphix.com>
  Approved by: Robert Mustacchi <r...@joyent.com>
  Author: George Wilson <george.wil...@delphix.com>

Modified:
  stable/11/cddl/contrib/opensolaris/cmd/ztest/ztest.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/contrib/opensolaris/cmd/ztest/ztest.c
==============================================================================
--- stable/11/cddl/contrib/opensolaris/cmd/ztest/ztest.c        Fri Oct 14 
07:19:08 2016        (r307270)
+++ stable/11/cddl/contrib/opensolaris/cmd/ztest/ztest.c        Fri Oct 14 
07:20:07 2016        (r307271)
@@ -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 <m...@freebsd.org>.  All rights reserved.
  * Copyright (c) 2013 Steven Hartland. All rights reserved.
@@ -5022,9 +5022,14 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_
                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;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to