From 896c2a78bf1ed6fbb1d5ee86ee4af55a71171537 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Mon, 21 Mar 2022 15:19:17 -0600 Subject: [PATCH] LU-13717 llite: fix crypto patch merge errors Due to delayed landing of crypto patches, there was a semantic conflict with another patch that changed the ll_getattr() function prototype code but did not block the patch from landing. Test-Parameters: trivial testlist=sanity-sec Fixes: 3256c354a6 ("LU-13717 sec: filename encryption - symlink support") Fixes: afec2fef71 ("LU-13717 sec: filename encryption") Signed-off-by: Andreas Dilger Change-Id: Ia07d6e60f1840889a371538ce5414315e65f6e11 Reviewed-on: https://review.whamcloud.com/46877 Tested-by: jenkins Reviewed-by: Patrick Farrell --- lustre/llite/symlink.c | 9 ++++++++- lustre/mdd/mdd_dir.c | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lustre/llite/symlink.c b/lustre/llite/symlink.c index 989be43..3195e75 100644 --- a/lustre/llite/symlink.c +++ b/lustre/llite/symlink.c @@ -280,8 +280,15 @@ static const char *ll_follow_link(struct dentry *dentry, void **cookie) * * Return: 0 on success, -errno on failure */ + +#if defined(HAVE_USER_NAMESPACE_ARG) +static int ll_getattr_link(struct user_namespace *mnt_userns, + const struct path *path, struct kstat *stat, + u32 request_mask, unsigned int flags) +#else static int ll_getattr_link(const struct path *path, struct kstat *stat, u32 request_mask, unsigned int flags) +#endif { struct dentry *dentry = path->dentry; struct inode *inode = d_inode(dentry); @@ -289,7 +296,7 @@ static int ll_getattr_link(const struct path *path, struct kstat *stat, const char *link; int rc; - rc = ll_getattr(path, stat, request_mask, flags); + rc = ll_getattr(mnt_userns, path, stat, request_mask, flags); if (rc || !IS_ENCRYPTED(inode)) return rc; diff --git a/lustre/mdd/mdd_dir.c b/lustre/mdd/mdd_dir.c index ee8ec01e..26abde1 100644 --- a/lustre/mdd/mdd_dir.c +++ b/lustre/mdd/mdd_dir.c @@ -60,8 +60,8 @@ mdd_name_check(const struct lu_env *env, struct mdd_device *m, const struct lu_name *ln) { struct mdd_thread_info *info = mdd_env_info(env); - bool enc = info->mti_pattr.la_valid & LA_FLAGS && - info->mti_pattr.la_flags & LUSTRE_ENCRYPT_FL; + bool enc = info->mdi_pattr.la_valid & LA_FLAGS && + info->mdi_pattr.la_flags & LUSTRE_ENCRYPT_FL; if (!lu_name_is_valid(ln)) return -EINVAL; -- 1.8.3.1