mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Disable normalization implicitly when setting "utf8only=off"
When a parent dataset has normalization set to any value other than "none", and a file system is created with the property "utf8only=off", implicitly also set "normalization=none" instead of overriding the desire for a non-UTF8 enforcing file system. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Mike Swanson <mikeonthecomputer@gmail.com> Closes #11892 Closes #12038
This commit is contained in:
@@ -1562,6 +1562,9 @@ badlabel:
|
||||
*
|
||||
* 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,
|
||||
@@ -1575,6 +1578,12 @@ badlabel:
|
||||
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user