Long hold the dataset during upgrade

If the receive or rollback is performed while filesystem is upgrading
the objset may be evicted in `dsl_dataset_clone_swap_sync_impl`. This
will lead to NULL pointer dereference when upgrade tries to access
evicted objset.

This commit adds long hold of dataset during whole upgrade process.
The receive and rollback will return an EBUSY error until the
upgrade is not finished.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Arkadiusz Bubała <arkadiusz.bubala@open-e.com>
Closes #5295 
Closes #6837
This commit is contained in:
Arkadiusz Bubała
2017-11-10 22:37:10 +01:00
committed by Brian Behlendorf
parent 62df1bc813
commit c0daec32f8
3 changed files with 24 additions and 9 deletions
+6 -1
View File
@@ -834,8 +834,13 @@ zfs_fuid_overobjquota(zfsvfs_t *zfsvfs, boolean_t isgroup, uint64_t fuid)
int err;
if (!dmu_objset_userobjspace_present(zfsvfs->z_os)) {
if (dmu_objset_userobjspace_upgradable(zfsvfs->z_os))
if (dmu_objset_userobjspace_upgradable(zfsvfs->z_os)) {
dsl_pool_config_enter(
dmu_objset_pool(zfsvfs->z_os), FTAG);
dmu_objset_userobjspace_upgrade(zfsvfs->z_os);
dsl_pool_config_exit(
dmu_objset_pool(zfsvfs->z_os), FTAG);
}
return (B_FALSE);
}