From e897a23eb13bafcf9c38d2fc37ae57a7729d9a02 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 24 Sep 2018 17:11:25 -0700 Subject: Fix statfs(2) for 32-bit user space When handling a 32-bit statfs() system call the returned fields, although 64-bit in the kernel, must be limited to 32-bits or an EOVERFLOW error will be returned. This is less of an issue for block counts since the default reported block size in 128KiB. But since it is possible to set a smaller block size, these values will be scaled as needed to fit in a 32-bit unsigned long. Unlike most other filesystems the total possible file counts are more likely to overflow because they are calculated based on the available free space in the pool. In order to prevent this the reported value must be capped at 2^32-1. This is only for statfs(2) reporting, there are no changes to the internal ZFS limits. Reviewed-by: Andreas Dilger Reviewed-by: Richard Yao Signed-off-by: Brian Behlendorf Issue #7927 Closes #7122 Closes #7937 --- config/kernel.m4 | 1 + 1 file changed, 1 insertion(+) (limited to 'config/kernel.m4') diff --git a/config/kernel.m4 b/config/kernel.m4 index 7b92c4744..118f1d8dc 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -160,6 +160,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ ZFS_AC_KERNEL_GLOBAL_PAGE_STATE ZFS_AC_KERNEL_ACL_HAS_REFCOUNT ZFS_AC_KERNEL_USERNS_CAPABILITIES + ZFS_AC_KERNEL_IN_COMPAT_SYSCALL AS_IF([test "$LINUX_OBJ" != "$LINUX"], [ KERNEL_MAKE="$KERNEL_MAKE O=$LINUX_OBJ" -- cgit v1.2.3