Re: svn commit: r325320 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs [breaks lld on zfs: lld uses fallocate]

From: Mark Millard <markmi_at_dsl-only.net>
Date: Sat, 4 Nov 2017 09:46:29 -0700
On 2017-Nov-4, at 5:04 AM, Andriy Gapon <avg at FreeBSD.org> wrote:

> On 04/11/2017 13:41, Andriy Gapon wrote:
>> On 04/11/2017 12:32, Mark Millard wrote:
>>>  if (int Err = ::posix_fallocate(FD, 0, Size)) {
>>>    if (Err != EOPNOTSUPP)
>>>      return std::error_code(Err, std::generic_category());
>>>  }
>> 
>> The commit message that you didn't include into your reply contains some useful
>> information that authors / maintainers of this code should probably take into
>> account:
>> 
>>>  Please note that EINVAL is used to report that the underlying file system
>>>  does not support the operation (POSIX.1-2008).
>> 
>> Here is a link for that:
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html

I had no doubt about the change being required or
per-specification and did not think to list the
reference.

It was more that world's use of fallocate was not
reviewed and possibly adjusted first that caused
problems.

FYI:

It appears that sqlite3 might use fallocate.
And heimdal (via its sqlite3.c). I've not
reviewed the details for any of the below
that do not trace to the lld issue:

# grep -rl "fallocate" /usr/src/* | more
/usr/src/contrib/sqlite3/configure.ac
/usr/src/contrib/sqlite3/configure
/usr/src/contrib/sqlite3/sqlite3.c
/usr/src/contrib/netbsd-tests/lib/libc/sys/t_posix_fallocate.c
/usr/src/contrib/compiler-rt/lib/dfsan/libc_ubuntu1404_abilist.txt
/usr/src/contrib/compiler-rt/include/sanitizer/linux_syscall_hooks.h
/usr/src/contrib/llvm/lib/Support/Unix/Path.inc
/usr/src/contrib/pjdfstest/configure.ac
/usr/src/contrib/pjdfstest/tests/misc.sh
/usr/src/contrib/pjdfstest/pjdfstest.c
/usr/src/contrib/openbsm/NEWS
/usr/src/contrib/openbsm/etc/audit_event
/usr/src/crypto/heimdal/lib/sqlite/sqlite3.c
/usr/src/lib/libc/sys/posix_fallocate.2
/usr/src/lib/libc/sys/Symbol.map
/usr/src/lib/libc/sys/Makefile.inc
/usr/src/lib/libc/tests/sys/Makefile
/usr/src/lib/clang/include/llvm/Config/config.h
/usr/src/share/man/man9/VOP_ALLOCATE.9
/usr/src/sys/compat/freebsd32/syscalls.master
/usr/src/sys/compat/freebsd32/freebsd32_syscalls.c
/usr/src/sys/compat/freebsd32/freebsd32_sysent.c
/usr/src/sys/compat/freebsd32/capabilities.conf
/usr/src/sys/compat/freebsd32/freebsd32_misc.c
/usr/src/sys/compat/freebsd32/freebsd32_proto.h
/usr/src/sys/compat/freebsd32/freebsd32_syscall.h
/usr/src/sys/compat/freebsd32/freebsd32_systrace_args.c
/usr/src/sys/compat/cloudabi/cloudabi_file.c
/usr/src/sys/compat/linux/linux_file.c
/usr/src/sys/i386/linux/linux_sysent.c
/usr/src/sys/i386/linux/linux_proto.h
/usr/src/sys/i386/linux/linux_syscalls.c
/usr/src/sys/i386/linux/linux_systrace_args.c
/usr/src/sys/i386/linux/linux_syscall.h
/usr/src/sys/i386/linux/syscalls.master
/usr/src/sys/sys/fcntl.h
/usr/src/sys/sys/syscall.h
/usr/src/sys/sys/syscall.mk
/usr/src/sys/sys/syscallsubr.h
/usr/src/sys/sys/sysproto.h
/usr/src/sys/kern/init_sysent.c
/usr/src/sys/kern/syscalls.master
/usr/src/sys/kern/systrace_args.c
/usr/src/sys/kern/capabilities.conf
/usr/src/sys/kern/vfs_syscalls.c
/usr/src/sys/kern/syscalls.c
/usr/src/sys/amd64/linux32/linux32_syscall.h
/usr/src/sys/amd64/linux32/linux32_systrace_args.c
/usr/src/sys/amd64/linux32/syscalls.master
/usr/src/sys/amd64/linux32/linux32_syscalls.c
/usr/src/sys/amd64/linux32/linux32_sysent.c
/usr/src/sys/amd64/linux32/linux32_proto.h
/usr/src/sys/amd64/linux/linux_proto.h
/usr/src/sys/amd64/linux/syscalls.master
/usr/src/sys/amd64/linux/linux_syscalls.c
/usr/src/sys/amd64/linux/linux_systrace_args.c
/usr/src/sys/amd64/linux/linux_syscall.h
/usr/src/sys/amd64/linux/linux_sysent.c
/usr/src/tests/sys/pjdfstest/config.h


> My response above is quite dry, so I want to add this.
> Thank you very much for the deep analysis.
> I am sorry for the trouble that my change caused, but I think that its root
> cause lies elsewhere (lld, posix).

You are welcome.

-- 
Andriy Gapon
Received on Sat Nov 04 2017 - 15:46:38 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:13 UTC