OpenAFS Master Repository branch, master, updated. openafs-devel-1_9_0-129-g1bd6850
Gerrit Code Review
gerrit@openafs.org
Fri, 12 Mar 2021 07:43:03 -0500
The following commit has been merged in the master branch:
commit 1bd68506be3243c5670aaf53798b2e4e715d4c8b
Author: Cheyenne Wills <cwills@sinenomine.net>
Date: Fri Mar 5 16:31:03 2021 -0700
Linux 5.12: Add user_namespace param to inode ops
The Linux commits:
"fs: make helpers idmap mount aware" (549c72977) and
"attr: handle idmapped mounts" (2f221d6f7) that were merged into
Linux-5.12-rc1 cause a build failure when creating the kernel module.
Several functions within the inode_operations structure had their
signature updated to include a user_namespace parameter. This allows
a filesystem to support idmapped mounts.
OpenAFS only implements some of the changed functions.
LINUX/vnodeops function inode_operation
===================== ===============
afs_notify_change setattr
afs_linux_getattr getattr
afs_linux_create create
afs_linux_symlink symlink
afs_linux_mkdir mkdir
afs_linux_rename rename
afs_linux_permission permission
Update the autoconf tests to determine if the Linux kernel requires
the user_namespace structure for inode_operations functions. If so,
define a generic "IOP_TAKES_USER_NAMESPACE" macro.
Update the above vnodeops functions to accept a 'struct user_namespace'
parameter.
When using the 'setattr_prepare' function a user namespace must be
now provided. In order to provide compatibility as a non-idmapped mount
filesystem the initial user namespace can be used. With OpenAFS, the
initial user namespace obtained at kernel module load time is stored in
a global variable 'afs_ns'.
Update the call to setattr_prepare to pass the user namespace pointed
to by the 'afs_ns' global variable.
Update calls to setattr to pass the user namespace pointed to by
the 'afs_ns' global variable.
Notes:
The changes introduced with Linux 5.12 allow a filesystem to support
idmapped mounts if desired. This commit does not implement support for
idmapped mounts, but will continue to use the same initial user
namespace as prior to Linux 5.12.
With Linux 5.12 the following autoconf checks fail:
HAVE_LINUX_INODE_OPERATIONS_RENAME_TAKES_FLAGS
HAVE_LINUX_SETATTR_PREPARE
IOP_CREATE_TAKES_BOOL
IOP_GETATTR_TAKES_PATH_STRUCT
IOP_MKDIR_TAKES_UMODE_T
The new macro 'IOP_TAKES_USER_NAMESPACE' covers the cases where these
macros where used.
Change-Id: Id450d5c716137340ed20af5531c0cd756e4435cd
Reviewed-on: https://gerrit.openafs.org/14549
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/afs/LINUX/osi_compat.h | 8 ++++-
src/afs/LINUX/osi_vnodeops.c | 69 ++++++++++++++++++++++++++++++++++++-----
src/cf/linux-kernel-sig.m4 | 16 +++++++++-
3 files changed, 81 insertions(+), 12 deletions(-)
--
OpenAFS Master Repository