From d86debf5762c0d18574af67407f4c99fd9aaec3a Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Wed, 28 Apr 2021 19:19:28 +0000 Subject: [PATCH] FreeBSD: Use SET_ERROR to trace xattr name errors Reviewed-by: Brian Behlendorf Reviewed-by: Alexander Motin Signed-off-by: Ryan Moeller Closes #11997 --- module/os/freebsd/zfs/zfs_vnops_os.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module/os/freebsd/zfs/zfs_vnops_os.c b/module/os/freebsd/zfs/zfs_vnops_os.c index 1214f8a2b..e05d1ab07 100644 --- a/module/os/freebsd/zfs/zfs_vnops_os.c +++ b/module/os/freebsd/zfs/zfs_vnops_os.c @@ -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); }