From 988431966639d791ac269011d136e85f3602df75 Mon Sep 17 00:00:00 2001 From: Damian Szuberski Date: Thu, 16 Jun 2022 07:20:28 +1000 Subject: [PATCH] Fix clang 13 compilation errors ``` os/linux/zfs/zvol_os.c:1111:3: error: ignoring return value of function declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] add_disk(zv->zv_zso->zvo_disk); ^~~~~~~~ ~~~~~~~~~~~~~~~~~~~~ zpl_xattr.c:1579:1: warning: no previous prototype for function 'zpl_posix_acl_release_impl' [-Wmissing-prototypes] ``` Reviewed-by: Brian Behlendorf Signed-off-by: szubersk Closes #13551 --- config/kernel-add-disk.m4 | 3 +-- module/os/linux/zfs/zpl_xattr.c | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/config/kernel-add-disk.m4 b/config/kernel-add-disk.m4 index 44a8a5fd2..86d81ea32 100644 --- a/config/kernel-add-disk.m4 +++ b/config/kernel-add-disk.m4 @@ -7,8 +7,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_ADD_DISK], [ #include ], [ struct gendisk *disk = NULL; - int err = add_disk(disk); - err = err; + int error __attribute__ ((unused)) = add_disk(disk); ]) ]) diff --git a/module/os/linux/zfs/zpl_xattr.c b/module/os/linux/zfs/zpl_xattr.c index c53bf3c2a..c30ce1c98 100644 --- a/module/os/linux/zfs/zpl_xattr.c +++ b/module/os/linux/zfs/zpl_xattr.c @@ -83,6 +83,7 @@ #include #include #include +#include enum xattr_permission { XAPERM_DENY, @@ -1495,7 +1496,9 @@ zpl_xattr_permission(xattr_filldir_t *xf, const char *name, int name_len) return (perm); } -#if !defined(HAVE_POSIX_ACL_RELEASE) || defined(HAVE_POSIX_ACL_RELEASE_GPL_ONLY) +#if defined(CONFIG_FS_POSIX_ACL) && \ + (!defined(HAVE_POSIX_ACL_RELEASE) || \ + defined(HAVE_POSIX_ACL_RELEASE_GPL_ONLY)) struct acl_rel_struct { struct acl_rel_struct *next; struct posix_acl *acl;