]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Forward compatibility for ino64.
authorWarner Losh <imp@FreeBSD.org>
Fri, 23 Jun 2017 18:06:20 +0000 (18:06 +0000)
committerWarner Losh <imp@FreeBSD.org>
Fri, 23 Jun 2017 18:06:20 +0000 (18:06 +0000)
commit5ab191c42bda98fe31ebe78a933976ffc085a959
tree56b2dfea0b114b30dc8d233a103406e65084f26d
parente978052623fb50e8f923c959379f32256a6fb63e
Forward compatibility for ino64.

Add forward compatibility so that new binaries can run on old
kernels. If the new system call from ino64 isn't available on your
system, then the old one will be used and the results translated.  The
stat and statfs families of functions are fully emulated. While not
required by policy, in this case it is helpful to our users to provide
this compatibility. In this case, it allows rollback of the kernel
after installing a new userland should a problem be discovered. It
also prevents foot-shooting if a user does an install before rebooting
with the new kernel. Finally, it allows the use case where one needs
to run new binaries on an old kernel as part of an upgrade process.

The getdirentries family uses tricks that may not work on remote
filesystems. Specifically, it uses a buffer 1/4 the size requested to
get the data from he old syscall.

The code carefully uses direct syscalls for old system calls to avoid
referencing freebsd11_* symbols, which contaminate ld-elf.so.1's
export table due to its use of stat functions, which causes errno to
be incorrect in client programs due to the wrong *stat* function being
resolved in some cases.

This code should removed sometime after 12 is branched.

Tested on: 12-current binaries on a 10.3-beta kernel run and return
       consistent results. 12-current kernel and userland with
       packages from before ino64 was committed also work.

Differential Revision: https://reviews.freebsd.org/D11185
Reviewed by: kib@, emaste@
13 files changed:
UPDATING
lib/libc/include/libc_private.h
lib/libc/sys/Makefile.inc
lib/libc/sys/compat-ino64.h [new file with mode: 0644]
lib/libc/sys/fstat.c [new file with mode: 0644]
lib/libc/sys/fstatat.c [new file with mode: 0644]
lib/libc/sys/fstatfs.c [new file with mode: 0644]
lib/libc/sys/getdents.c
lib/libc/sys/getdirentries.c [new file with mode: 0644]
lib/libc/sys/getfsstat.c [new file with mode: 0644]
lib/libc/sys/lstat.c
lib/libc/sys/stat.c
lib/libc/sys/statfs.c [new file with mode: 0644]