Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/libzfs/libzfs_dataset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,9 @@ zfs_valid_proplist(libzfs_handle_t *hdl, zfs_type_t type, nvlist_t *nvl,
*
* If normalization was chosen, but rejecting non-UTF8 names
* was explicitly not chosen, it is an error.
*
* If utf8only was turned off, but the parent has normalization,
* turn off normalization.
*/
if (chosen_normal > 0 && chosen_utf < 0) {
if (nvlist_add_uint64(ret,
Expand All @@ -1575,6 +1578,12 @@ zfs_valid_proplist(libzfs_handle_t *hdl, zfs_type_t type, nvlist_t *nvl,
zfs_prop_to_name(ZFS_PROP_UTF8ONLY));
(void) zfs_error(hdl, EZFS_BADPROP, errbuf);
goto error;
} else if (chosen_normal < 0 && chosen_utf == 0) {
if (nvlist_add_uint64(ret,
zfs_prop_to_name(ZFS_PROP_NORMALIZE), 0) != 0) {
(void) no_memory(hdl);
goto error;
}
}
return (ret);

Expand Down
11 changes: 11 additions & 0 deletions tests/zfs-tests/tests/functional/casenorm/norm_all_values.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,15 @@ for form in formC formD formKC formKD; do
destroy_testfs
done

for form in formC formD formKC formKD; do
create_testfs "-o normalization=$form"
log_must zfs create -o utf8only=off $TESTPOOL/$TESTFS/$TESTSUBFS
normalization=$(zfs get -H -o value normalization $TESTPOOL/$TESTFS/$TESTSUBFS)
if [[ $normalization != "none" ]]; then
log_fail "Turning off utf8only didn't set normalization to none"
fi
log_must zfs destroy $TESTPOOL/$TESTFS/$TESTSUBFS
destroy_testfs
done

log_pass "Can create FS with all supported normalization forms"