1 From 938bd1adc15342e8ebed3d4e135d862e362a619e Mon Sep 17 00:00:00 2001
2 From: Robbie Harwood <rharwood@redhat.com>
3 Date: Thu, 25 May 2017 13:06:17 -0400
4 Subject: [PATCH] Make proc file failure loud but nonfatal
6 Signed-off-by: Robbie Harwood <rharwood@redhat.com>
7 Reviewed-by: Simo Sorce <simo@redhat.com>
9 (cherry picked from commit 4f60bf02a1a68cbb26251e764357b753f80790f3)
11 proxy/src/gp_init.c | 34 +++++++++++++++-------------------
12 1 file changed, 15 insertions(+), 19 deletions(-)
14 diff --git a/proxy/src/gp_init.c b/proxy/src/gp_init.c
15 index bb7ba6b..d367f92 100644
16 --- a/proxy/src/gp_init.c
17 +++ b/proxy/src/gp_init.c
18 @@ -144,11 +144,11 @@ void init_proc_nfsd(struct gp_config *cfg)
25 /* check first if any service enabled kernel support */
26 - for (i = 0; i < cfg->num_svcs; i++) {
27 - if (cfg->svcs[i]->kernel_nfsd == true) {
28 + for (int i = 0; i < cfg->num_svcs; i++) {
29 + if (cfg->svcs[i]->kernel_nfsd) {
33 @@ -161,30 +161,26 @@ void init_proc_nfsd(struct gp_config *cfg)
34 fd = open(LINUX_PROC_USE_GSS_PROXY_FILE, O_RDWR);
37 - fprintf(stderr, "GSS-Proxy is not supported by this kernel since "
38 - "file %s could not be found: %d (%s)\n",
39 - LINUX_PROC_USE_GSS_PROXY_FILE,
40 - ret, gp_strerror(ret));
42 + GPDEBUG("Kernel doesn't support GSS-Proxy (can't open %s: %d (%s))\n",
43 + LINUX_PROC_USE_GSS_PROXY_FILE, ret, gp_strerror(ret));
47 ret = write(fd, buf, 1);
50 - fprintf(stderr, "Failed to write to %s: %d (%s)\n",
51 - LINUX_PROC_USE_GSS_PROXY_FILE,
52 - ret, gp_strerror(ret));
54 + GPDEBUG("Failed to write to %s: %d (%s)\n",
55 + LINUX_PROC_USE_GSS_PROXY_FILE, ret, gp_strerror(ret));
61 - fprintf(stderr, "Failed to close %s: %d (%s)\n",
62 - LINUX_PROC_USE_GSS_PROXY_FILE,
63 - ret, gp_strerror(ret));
72 + GPDEBUG("Problem with kernel communication! NFS server will not work\n");