summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2018-02-21 14:55:55 +0200
committerPrakash Surya <prakash.surya@delphix.com>2018-03-14 08:55:08 -0700
commit5f5913bb83405db87f982abee80162a479d363af (patch)
treeb970b8963f61b3f6efad90d54a58ff04873b09ab
parentb13f152e9f7bf4b4426892b07a35568bd4d9e17f (diff)
downloadillumos-joyent-5f5913bb83405db87f982abee80162a479d363af.tar.gz
9164 assert: newds == os->os_dsl_dataset
Reviewed by: Matt Ahrens <mahrens@delphix.com> Reviewed by: Don Brady <don.brady@delphix.com> Approved by: Richard Lowe <richlowe@richlowe.net>
-rw-r--r--usr/src/uts/common/fs/zfs/dmu_objset.c12
-rw-r--r--usr/src/uts/common/fs/zfs/sys/dmu_objset.h3
-rw-r--r--usr/src/uts/common/fs/zfs/zfs_ioctl.c6
3 files changed, 10 insertions, 11 deletions
diff --git a/usr/src/uts/common/fs/zfs/dmu_objset.c b/usr/src/uts/common/fs/zfs/dmu_objset.c
index 71d616415c..574812d3b4 100644
--- a/usr/src/uts/common/fs/zfs/dmu_objset.c
+++ b/usr/src/uts/common/fs/zfs/dmu_objset.c
@@ -670,23 +670,21 @@ dmu_objset_rele(objset_t *os, void *tag)
* same name so that it can be partially torn down and reconstructed.
*/
void
-dmu_objset_refresh_ownership(objset_t *os, void *tag)
+dmu_objset_refresh_ownership(dsl_dataset_t *ds, dsl_dataset_t **newds,
+ void *tag)
{
dsl_pool_t *dp;
- dsl_dataset_t *ds, *newds;
char name[ZFS_MAX_DATASET_NAME_LEN];
- ds = os->os_dsl_dataset;
VERIFY3P(ds, !=, NULL);
VERIFY3P(ds->ds_owner, ==, tag);
VERIFY(dsl_dataset_long_held(ds));
dsl_dataset_name(ds, name);
- dp = dmu_objset_pool(os);
+ dp = ds->ds_dir->dd_pool;
dsl_pool_config_enter(dp, FTAG);
- dmu_objset_disown(os, tag);
- VERIFY0(dsl_dataset_own(dp, name, tag, &newds));
- VERIFY3P(newds, ==, os->os_dsl_dataset);
+ dsl_dataset_disown(ds, tag);
+ VERIFY0(dsl_dataset_own(dp, name, tag, newds));
dsl_pool_config_exit(dp, FTAG);
}
diff --git a/usr/src/uts/common/fs/zfs/sys/dmu_objset.h b/usr/src/uts/common/fs/zfs/sys/dmu_objset.h
index b20a9f9557..59e87aab80 100644
--- a/usr/src/uts/common/fs/zfs/sys/dmu_objset.h
+++ b/usr/src/uts/common/fs/zfs/sys/dmu_objset.h
@@ -153,7 +153,8 @@ int dmu_objset_own(const char *name, dmu_objset_type_t type,
boolean_t readonly, void *tag, objset_t **osp);
int dmu_objset_own_obj(struct dsl_pool *dp, uint64_t obj,
dmu_objset_type_t type, boolean_t readonly, void *tag, objset_t **osp);
-void dmu_objset_refresh_ownership(objset_t *os, void *tag);
+void dmu_objset_refresh_ownership(struct dsl_dataset *ds,
+ struct dsl_dataset **newds, void *tag);
void dmu_objset_rele(objset_t *os, void *tag);
void dmu_objset_disown(objset_t *os, void *tag);
int dmu_objset_from_ds(struct dsl_dataset *ds, objset_t **osp);
diff --git a/usr/src/uts/common/fs/zfs/zfs_ioctl.c b/usr/src/uts/common/fs/zfs/zfs_ioctl.c
index 4d9556ccaf..744688f7b4 100644
--- a/usr/src/uts/common/fs/zfs/zfs_ioctl.c
+++ b/usr/src/uts/common/fs/zfs/zfs_ioctl.c
@@ -4925,14 +4925,14 @@ zfs_ioc_userspace_upgrade(zfs_cmd_t *zc)
* objset needs to be closed & reopened (to grow the
* objset_phys_t). Suspend/resume the fs will do that.
*/
- dsl_dataset_t *ds;
+ dsl_dataset_t *ds, *newds;
ds = dmu_objset_ds(zfsvfs->z_os);
error = zfs_suspend_fs(zfsvfs);
if (error == 0) {
- dmu_objset_refresh_ownership(zfsvfs->z_os,
+ dmu_objset_refresh_ownership(ds, &newds,
zfsvfs);
- error = zfs_resume_fs(zfsvfs, ds);
+ error = zfs_resume_fs(zfsvfs, newds);
}
}
if (error == 0)