diff options
author | George Amanakis <[email protected]> | 2022-11-18 20:38:37 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2022-11-18 11:38:37 -0800 |
commit | 3226e0dc8ef6f7770035c42b28f2b088bbdd2944 (patch) | |
tree | 189994bf4defe4139eda5c5e50361c6af99cc791 /module/zfs/dsl_dataset.c | |
parent | 99c0479a4ef4cbfdf49ad05a4457d0872ab98f4c (diff) |
Fix setting the large_block feature after receiving a snapshot
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 on that filesystem since the filesystem is not on
dp_dirty_datasets, and a subsequent encrypted raw send will fail.
Fix this by checking in dsl_dataset_snapshot_sync_impl() if the feature
needs to be activated and do so if appropriate.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: George Amanakis <[email protected]>
Closes #13699
Closes #13782
Diffstat (limited to 'module/zfs/dsl_dataset.c')
-rw-r--r-- | module/zfs/dsl_dataset.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/module/zfs/dsl_dataset.c b/module/zfs/dsl_dataset.c index c7577fc58..4da4effca 100644 --- a/module/zfs/dsl_dataset.c +++ b/module/zfs/dsl_dataset.c @@ -1760,6 +1760,21 @@ 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. + */ + 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]; + } + } + ASSERT3U(ds->ds_prev != 0, ==, dsl_dataset_phys(ds)->ds_prev_snap_obj != 0); if (ds->ds_prev) { |