mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 11:19:32 +03:00
FreeBSD: Use SET_ERROR to trace xattr name errors
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #11997
This commit is contained in:
parent
099ca8186b
commit
d86debf576
@ -5250,10 +5250,10 @@ zfs_create_attrname(int attrnamespace, const char *name, char *attrname,
|
||||
|
||||
/* We don't allow '/' character in attribute name. */
|
||||
if (strchr(name, '/') != NULL)
|
||||
return (EINVAL);
|
||||
return (SET_ERROR(EINVAL));
|
||||
/* We don't allow attribute names that start with "freebsd:" string. */
|
||||
if (strncmp(name, "freebsd:", 8) == 0)
|
||||
return (EINVAL);
|
||||
return (SET_ERROR(EINVAL));
|
||||
|
||||
bzero(attrname, size);
|
||||
|
||||
@ -5278,11 +5278,11 @@ zfs_create_attrname(int attrnamespace, const char *name, char *attrname,
|
||||
break;
|
||||
case EXTATTR_NAMESPACE_EMPTY:
|
||||
default:
|
||||
return (EINVAL);
|
||||
return (SET_ERROR(EINVAL));
|
||||
}
|
||||
if (snprintf(attrname, size, "%s%s%s%s", prefix, namespace, suffix,
|
||||
name) >= size) {
|
||||
return (ENAMETOOLONG);
|
||||
return (SET_ERROR(ENAMETOOLONG));
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user