Skip to content
This repository was archived by the owner on Nov 7, 2019. It is now read-only.

Commit 0e776dc

Browse files
avg-IPrakash Surya
authored andcommitted
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> Closes #559
1 parent 6a9c107 commit 0e776dc

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

usr/src/uts/common/fs/zfs/dmu_objset.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -670,23 +670,21 @@ dmu_objset_rele(objset_t *os, void *tag)
670670
* same name so that it can be partially torn down and reconstructed.
671671
*/
672672
void
673-
dmu_objset_refresh_ownership(objset_t *os, void *tag)
673+
dmu_objset_refresh_ownership(dsl_dataset_t *ds, dsl_dataset_t **newds,
674+
void *tag)
674675
{
675676
dsl_pool_t *dp;
676-
dsl_dataset_t *ds, *newds;
677677
char name[ZFS_MAX_DATASET_NAME_LEN];
678678

679-
ds = os->os_dsl_dataset;
680679
VERIFY3P(ds, !=, NULL);
681680
VERIFY3P(ds->ds_owner, ==, tag);
682681
VERIFY(dsl_dataset_long_held(ds));
683682

684683
dsl_dataset_name(ds, name);
685-
dp = dmu_objset_pool(os);
684+
dp = ds->ds_dir->dd_pool;
686685
dsl_pool_config_enter(dp, FTAG);
687-
dmu_objset_disown(os, tag);
688-
VERIFY0(dsl_dataset_own(dp, name, tag, &newds));
689-
VERIFY3P(newds, ==, os->os_dsl_dataset);
686+
dsl_dataset_disown(ds, tag);
687+
VERIFY0(dsl_dataset_own(dp, name, tag, newds));
690688
dsl_pool_config_exit(dp, FTAG);
691689
}
692690

usr/src/uts/common/fs/zfs/sys/dmu_objset.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ int dmu_objset_own(const char *name, dmu_objset_type_t type,
153153
boolean_t readonly, void *tag, objset_t **osp);
154154
int dmu_objset_own_obj(struct dsl_pool *dp, uint64_t obj,
155155
dmu_objset_type_t type, boolean_t readonly, void *tag, objset_t **osp);
156-
void dmu_objset_refresh_ownership(objset_t *os, void *tag);
156+
void dmu_objset_refresh_ownership(struct dsl_dataset *ds,
157+
struct dsl_dataset **newds, void *tag);
157158
void dmu_objset_rele(objset_t *os, void *tag);
158159
void dmu_objset_disown(objset_t *os, void *tag);
159160
int dmu_objset_from_ds(struct dsl_dataset *ds, objset_t **osp);

usr/src/uts/common/fs/zfs/zfs_ioctl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4925,14 +4925,14 @@ zfs_ioc_userspace_upgrade(zfs_cmd_t *zc)
49254925
* objset needs to be closed & reopened (to grow the
49264926
* objset_phys_t). Suspend/resume the fs will do that.
49274927
*/
4928-
dsl_dataset_t *ds;
4928+
dsl_dataset_t *ds, *newds;
49294929

49304930
ds = dmu_objset_ds(zfsvfs->z_os);
49314931
error = zfs_suspend_fs(zfsvfs);
49324932
if (error == 0) {
4933-
dmu_objset_refresh_ownership(zfsvfs->z_os,
4933+
dmu_objset_refresh_ownership(ds, &newds,
49344934
zfsvfs);
4935-
error = zfs_resume_fs(zfsvfs, ds);
4935+
error = zfs_resume_fs(zfsvfs, newds);
49364936
}
49374937
}
49384938
if (error == 0)

0 commit comments

Comments
 (0)