mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Activate filesystem features only in syncing context
When activating filesystem features after receiving a snapshot, do so only in syncing context. Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: George Amanakis <gamanakis@gmail.com> Closes #14304 Closes #14252
This commit is contained in:
@@ -1761,16 +1761,20 @@ dsl_dataset_snapshot_sync_impl(dsl_dataset_t *ds, const char *snapname,
|
||||
|
||||
/*
|
||||
* We are not allowed to dirty a filesystem when done receiving
|
||||
* a snapshot. In this case the flag SPA_FEATURE_LARGE_BLOCKS will
|
||||
* not be set and a subsequent encrypted raw send will fail. Hence
|
||||
* activate this feature if needed here.
|
||||
* a snapshot. In this case some flags such as SPA_FEATURE_LARGE_BLOCKS
|
||||
* will not be set and a subsequent encrypted raw send will fail. Hence
|
||||
* activate this feature if needed here. This needs to happen only in
|
||||
* syncing context.
|
||||
*/
|
||||
for (spa_feature_t f = 0; f < SPA_FEATURES; f++) {
|
||||
if (zfeature_active(f, ds->ds_feature_activation[f]) &&
|
||||
!(zfeature_active(f, ds->ds_feature[f]))) {
|
||||
dsl_dataset_activate_feature(dsobj, f,
|
||||
ds->ds_feature_activation[f], tx);
|
||||
ds->ds_feature[f] = ds->ds_feature_activation[f];
|
||||
if (dmu_tx_is_syncing(tx)) {
|
||||
for (spa_feature_t f = 0; f < SPA_FEATURES; f++) {
|
||||
if (zfeature_active(f, ds->ds_feature_activation[f]) &&
|
||||
!(zfeature_active(f, ds->ds_feature[f]))) {
|
||||
dsl_dataset_activate_feature(dsobj, f,
|
||||
ds->ds_feature_activation[f], tx);
|
||||
ds->ds_feature[f] =
|
||||
ds->ds_feature_activation[f];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user