aboutsummaryrefslogtreecommitdiffstats
path: root/uts/common/fs/zfs/dmu_object.c
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2018-08-01 03:03:15 +0000
committerAlexander Motin <mav@FreeBSD.org>2018-08-01 03:03:15 +0000
commit03a8ca5bd7057f8ac70dd442e81abd0209c26c1a (patch)
treea154982c1787b7871e3563ecc5053107a1fde945 /uts/common/fs/zfs/dmu_object.c
parent82104b77fb7c3db11f137dfd2847a2e99c1b2829 (diff)
downloadsrc-03a8ca5bd7057f8ac70dd442e81abd0209c26c1a.tar.gz
src-03a8ca5bd7057f8ac70dd442e81abd0209c26c1a.zip
9328 zap code can take advantage of c99
9329 panic in zap_leaf_lookup() due to concurrent zapification illumos/illumos-gate@bf26014c5541b6119f34e0d95294b7f2eb105ac2 Reviewed by: Steve Gonczi <steve.gonczi@delphix.com> Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com> Reviewed by: Brad Lewis <brad.lewis@delphix.com> Approved by: Dan McDonald <danmcd@joyent.com> Author: Matthew Ahrens <mahrens@delphix.com>
Notes
Notes: svn path=/vendor-sys/illumos/dist/; revision=337027
Diffstat (limited to 'uts/common/fs/zfs/dmu_object.c')
-rw-r--r--uts/common/fs/zfs/dmu_object.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/uts/common/fs/zfs/dmu_object.c b/uts/common/fs/zfs/dmu_object.c
index 40898ef26d97..9f0f2b437c36 100644
--- a/uts/common/fs/zfs/dmu_object.c
+++ b/uts/common/fs/zfs/dmu_object.c
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+ * Copyright (c) 2013, 2017 by Delphix. All rights reserved.
* Copyright 2014 HybridCluster. All rights reserved.
*/
@@ -204,13 +204,19 @@ dmu_object_zapify(objset_t *mos, uint64_t object, dmu_object_type_t old_type,
}
ASSERT3U(dn->dn_type, ==, old_type);
ASSERT0(dn->dn_maxblkid);
+
+ /*
+ * We must initialize the ZAP data before changing the type,
+ * so that concurrent calls to *_is_zapified() can determine if
+ * the object has been completely zapified by checking the type.
+ */
+ mzap_create_impl(mos, object, 0, 0, tx);
+
dn->dn_next_type[tx->tx_txg & TXG_MASK] = dn->dn_type =
DMU_OTN_ZAP_METADATA;
dnode_setdirty(dn, tx);
dnode_rele(dn, FTAG);
- mzap_create_impl(mos, object, 0, 0, tx);
-
spa_feature_incr(dmu_objset_spa(mos),
SPA_FEATURE_EXTENSIBLE_DATASET, tx);
}