Add compat for changing posix_acl_valid arguments

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2022-09-21 14:36:11 -07:00
parent 78405bb5fd
commit 433a80c6fc
3 changed files with 16 additions and 1 deletions

View File

@@ -34,3 +34,12 @@ endif
ifneq (,$(shell grep 'FMODE_KABI_ITERATE' include/linux/fs.h))
ccflags-y += -DKC_FMODE_KABI_ITERATE
endif
#
# v4.7-rc2-23-g0d4d717f2583
#
# Added user_ns argument to posix_acl_valid
#
ifneq (,$(shell grep 'posix_acl_valid.*user_ns,' include/linux/posix_acl.h))
ccflags-y += -DKC_POSIX_ACL_VALID_USER_NS
endif

View File

@@ -258,7 +258,7 @@ int scoutfs_acl_set_xattr(struct dentry *dentry, const char *name, const void *v
return PTR_ERR(acl);
if (acl) {
ret = posix_acl_valid(&init_user_ns, acl);
ret = kc_posix_acl_valid(&init_user_ns, acl);
if (ret)
goto out;
}

View File

@@ -46,4 +46,10 @@ static inline int dir_emit_dots(struct file *file, void *dirent,
}
#endif
#ifdef KC_POSIX_ACL_VALID_USER_NS
#define kc_posix_acl_valid(user_ns, acl) posix_acl_valid(user_ns, acl)
#else
#define kc_posix_acl_valid(user_ns, acl) posix_acl_valid(acl)
#endif
#endif