Skip to content

Commit f6495d8

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

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

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)