diff options
Diffstat (limited to 'module/zfs/dmu_recv.c')
-rw-r--r-- | module/zfs/dmu_recv.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/module/zfs/dmu_recv.c b/module/zfs/dmu_recv.c index 9b3da032f..4877eb7e6 100644 --- a/module/zfs/dmu_recv.c +++ b/module/zfs/dmu_recv.c @@ -602,6 +602,13 @@ recv_begin_check_feature_flags_impl(uint64_t featureflags, spa_t *spa) !spa_feature_is_enabled(spa, SPA_FEATURE_REDACTED_DATASETS)) return (SET_ERROR(ENOTSUP)); + /* + * If the LONGNAME is not enabled on the target, fail that request. + */ + if ((featureflags & DMU_BACKUP_FEATURE_LONGNAME) && + !spa_feature_is_enabled(spa, SPA_FEATURE_LONGNAME)) + return (SET_ERROR(ENOTSUP)); + return (0); } @@ -991,6 +998,16 @@ dmu_recv_begin_sync(void *arg, dmu_tx_t *tx) dsl_dataset_phys(newds)->ds_flags |= DS_FLAG_INCONSISTENT; /* + * Activate longname feature if received + */ + if (featureflags & DMU_BACKUP_FEATURE_LONGNAME && + !dsl_dataset_feature_is_active(newds, SPA_FEATURE_LONGNAME)) { + dsl_dataset_activate_feature(newds->ds_object, + SPA_FEATURE_LONGNAME, (void *)B_TRUE, tx); + newds->ds_feature[SPA_FEATURE_LONGNAME] = (void *)B_TRUE; + } + + /* * If we actually created a non-clone, we need to create the objset * in our new dataset. If this is a raw send we postpone this until * dmu_recv_stream() so that we can allocate the metadnode with the |