@@ -1761,16 +1761,20 @@ dsl_dataset_snapshot_sync_impl(dsl_dataset_t *ds, const char *snapname,
1761
1761
1762
1762
/*
1763
1763
* 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.
1767
1768
*/
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
+ }
1774
1778
}
1775
1779
}
1776
1780
0 commit comments