From 9d347ae1d6aa642a86b710452b1978ea303dea09 Mon Sep 17 00:00:00 2001 From: Sebastien Buisson Date: Tue, 9 Mar 2021 17:11:44 +0100 Subject: [PATCH] LU-14462 gss: remove HAVE_SETNS from lgss_keyring For the sake of simplification, a previous patch removed the config check that sets HAVE_SETNS, due to the fact that in kernels 3.10+ function setns() necessarily exists. In this case, all #ifdef on HAVE_SETNS are erroneous because it is not set whereas the function is actually available. So remove all references to HAVE_SETNS in the code. Fixes: 8e88bbfef5 ("LU-12477 lustre: remove obsolete config checks") Signed-off-by: Sebastien Buisson Change-Id: Iab0726c3e847a210185cc8c9353a79976acb1381 Reviewed-on: https://review.whamcloud.com/41967 Reviewed-by: James Simmons Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/utils/gss/lgss_keyring.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lustre/utils/gss/lgss_keyring.c b/lustre/utils/gss/lgss_keyring.c index dfcb0ad..93fd94c 100644 --- a/lustre/utils/gss/lgss_keyring.c +++ b/lustre/utils/gss/lgss_keyring.c @@ -902,7 +902,6 @@ out: static int associate_with_ns(char *path) { -#ifdef HAVE_SETNS int fd, rc = -1; fd = open(path, O_RDONLY); @@ -912,9 +911,6 @@ static int associate_with_ns(char *path) } return rc; -#else - return -1; -#endif /* HAVE_SETNS */ } static int prepare_and_instantiate(struct lgss_cred *cred, key_serial_t keyid, @@ -967,10 +963,8 @@ int main(int argc, char *argv[]) char path[PATH_MAX] = ""; int other_ns = 0; int rc = 0; -#ifdef HAVE_SETNS struct stat parent_ns = { .st_ino = 0 }; struct stat caller_ns = { .st_ino = 0 }; -#endif set_log_level(); @@ -1064,7 +1058,6 @@ int main(int argc, char *argv[]) cred->lc_svc_type = uparam.kup_svc_type; cred->lc_self_nid = uparam.kup_selfnid; -#ifdef HAVE_SETNS /* Is caller in different namespace? */ snprintf(path, sizeof(path), "/proc/%d/ns/mnt", getpid()); if (stat(path, &parent_ns)) { @@ -1077,7 +1070,6 @@ int main(int argc, char *argv[]) else if (caller_ns.st_ino != parent_ns.st_ino) other_ns = 1; } -#endif /* HAVE_SETNS */ /* * if caller's namespace is different, fork a child and associate it -- 1.8.3.1