Skip to content

Commit 53da1a9

Browse files
committed
Activate filesystem features only in syncing context
Signed-off-by: George Amanakis <[email protected]>
1 parent c935fe2 commit 53da1a9

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed

module/zfs/dmu_objset.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2408,13 +2408,6 @@ dmu_objset_id_quota_upgrade_cb(objset_t *os)
24082408
dmu_objset_userobjspace_present(os))
24092409
return (SET_ERROR(ENOTSUP));
24102410

2411-
if (dmu_objset_userobjused_enabled(os))
2412-
dmu_objset_ds(os)->ds_feature_activation[
2413-
SPA_FEATURE_USEROBJ_ACCOUNTING] = (void *)B_TRUE;
2414-
if (dmu_objset_projectquota_enabled(os))
2415-
dmu_objset_ds(os)->ds_feature_activation[
2416-
SPA_FEATURE_PROJECT_QUOTA] = (void *)B_TRUE;
2417-
24182411
err = dmu_objset_space_upgrade(os);
24192412
if (err)
24202413
return (err);

module/zfs/dsl_dataset.c

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,16 +1761,20 @@ dsl_dataset_snapshot_sync_impl(dsl_dataset_t *ds, const char *snapname,
17611761

17621762
/*
17631763
* We are not allowed to dirty a filesystem when done receiving
1764-
* a snapshot. In this case the flag SPA_FEATURE_LARGE_BLOCKS will
1765-
* not be set and a subsequent encrypted raw send will fail. Hence
1766-
* activate this feature if needed here.
1764+
* a snapshot. In this case some flags such as SPA_FEATURE_LARGE_BLOCKS
1765+
* will not be set and a subsequent encrypted raw send will fail. Hence
1766+
* activate this feature if needed here. This needs to happen only in
1767+
* syncing context.
17671768
*/
1768-
for (spa_feature_t f = 0; f < SPA_FEATURES; f++) {
1769-
if (zfeature_active(f, ds->ds_feature_activation[f]) &&
1770-
!(zfeature_active(f, ds->ds_feature[f]))) {
1771-
dsl_dataset_activate_feature(dsobj, f,
1772-
ds->ds_feature_activation[f], tx);
1773-
ds->ds_feature[f] = ds->ds_feature_activation[f];
1769+
if (dmu_tx_is_syncing(tx)) {
1770+
for (spa_feature_t f = 0; f < SPA_FEATURES; f++) {
1771+
if (zfeature_active(f, ds->ds_feature_activation[f]) &&
1772+
!(zfeature_active(f, ds->ds_feature[f]))) {
1773+
dsl_dataset_activate_feature(dsobj, f,
1774+
ds->ds_feature_activation[f], tx);
1775+
ds->ds_feature[f] =
1776+
ds->ds_feature_activation[f];
1777+
}
17741778
}
17751779
}
17761780

tests/zfs-tests/tests/functional/rsend/send_raw_large_blocks.ksh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ raw_backup=$TEST_BASE_DIR/raw_backup
4949
function cleanup
5050
{
5151
log_must rm -f $backup $raw_backup $ibackup $unc_backup
52-
destroy_pool pool_lb/fs
52+
destroy_pool pool_lb
5353
log_must rm -f $TESTDIR/vdev_a
5454
}
5555

0 commit comments

Comments
 (0)