Blame SOURCES/0031-NSS-enhanced-debug-during-mem-cache-initialization.patch

0ff280
From be8052bbb61c572702fe16e2850539f445dcc0e2 Mon Sep 17 00:00:00 2001
0ff280
From: Alexey Tikhonov <atikhono@redhat.com>
0ff280
Date: Wed, 4 Mar 2020 22:13:52 +0100
0ff280
Subject: [PATCH 31/35] NSS: enhanced debug during mem-cache initialization
0ff280
0ff280
Reviewed-by: Sumit Bose <sbose@redhat.com>
0ff280
---
0ff280
 src/responder/nss/nsssrv.c | 39 ++++++++++++++++++++++++++++++++------
0ff280
 1 file changed, 33 insertions(+), 6 deletions(-)
0ff280
0ff280
diff --git a/src/responder/nss/nsssrv.c b/src/responder/nss/nsssrv.c
0ff280
index 0a201d3ae..42a63d9bb 100644
0ff280
--- a/src/responder/nss/nsssrv.c
0ff280
+++ b/src/responder/nss/nsssrv.c
0ff280
@@ -255,7 +255,8 @@ static int setup_memcaches(struct nss_ctx *nctx)
0ff280
                          &mc_size_passwd);
0ff280
     if (ret != EOK) {
0ff280
         DEBUG(SSSDBG_FATAL_FAILURE,
0ff280
-              "Failed to get 'memcache_size_passwd' option from confdb.\n");
0ff280
+              "Failed to get '"CONFDB_NSS_MEMCACHE_SIZE_PASSWD
0ff280
+              "' option from confdb.\n");
0ff280
         return ret;
0ff280
     }
0ff280
 
0ff280
@@ -266,7 +267,8 @@ static int setup_memcaches(struct nss_ctx *nctx)
0ff280
                          &mc_size_group);
0ff280
     if (ret != EOK) {
0ff280
         DEBUG(SSSDBG_FATAL_FAILURE,
0ff280
-              "Failed to get 'memcache_size_group' option from confdb.\n");
0ff280
+              "Failed to get '"CONFDB_NSS_MEMCACHE_SIZE_GROUP
0ff280
+              "' option from confdb.\n");
0ff280
         return ret;
0ff280
     }
0ff280
 
0ff280
@@ -277,7 +279,8 @@ static int setup_memcaches(struct nss_ctx *nctx)
0ff280
                          &mc_size_initgroups);
0ff280
     if (ret != EOK) {
0ff280
         DEBUG(SSSDBG_FATAL_FAILURE,
0ff280
-              "Failed to get 'memcache_size_nitgroups' option from confdb.\n");
0ff280
+              "Failed to get '"CONFDB_NSS_MEMCACHE_SIZE_INITGROUPS
0ff280
+              "' option from confdb.\n");
0ff280
         return ret;
0ff280
     }
0ff280
 
0ff280
@@ -291,8 +294,16 @@ static int setup_memcaches(struct nss_ctx *nctx)
0ff280
                                   (time_t)memcache_timeout,
0ff280
                                   &nctx->pwd_mc_ctx);
0ff280
         if (ret) {
0ff280
-            DEBUG(SSSDBG_CRIT_FAILURE, "passwd mmap cache is DISABLED\n");
0ff280
+            DEBUG(SSSDBG_CRIT_FAILURE,
0ff280
+                  "Failed to initialize passwd mmap cache: '%s'\n",
0ff280
+                  sss_strerror(ret));
0ff280
+        } else {
0ff280
+            DEBUG(SSSDBG_CONF_SETTINGS, "Passwd mmap cache size is %d\n",
0ff280
+                  mc_size_passwd);
0ff280
         }
0ff280
+    } else {
0ff280
+        DEBUG(SSSDBG_IMPORTANT_INFO,
0ff280
+              "Passwd mmap cache is explicitly DISABLED\n");
0ff280
     }
0ff280
 
0ff280
     if (mc_size_group != 0) {
0ff280
@@ -303,8 +314,16 @@ static int setup_memcaches(struct nss_ctx *nctx)
0ff280
                                   (time_t)memcache_timeout,
0ff280
                                   &nctx->grp_mc_ctx);
0ff280
         if (ret) {
0ff280
-            DEBUG(SSSDBG_CRIT_FAILURE, "group mmap cache is DISABLED\n");
0ff280
+            DEBUG(SSSDBG_CRIT_FAILURE,
0ff280
+                  "Failed to initialize group mmap cache: '%s'\n",
0ff280
+                  sss_strerror(ret));
0ff280
+        } else {
0ff280
+            DEBUG(SSSDBG_CONF_SETTINGS, "Group mmap cache size is %d\n",
0ff280
+                  mc_size_group);
0ff280
         }
0ff280
+    } else {
0ff280
+        DEBUG(SSSDBG_IMPORTANT_INFO,
0ff280
+              "Group mmap cache is explicitly DISABLED\n");
0ff280
     }
0ff280
 
0ff280
     if (mc_size_initgroups != 0) {
0ff280
@@ -315,8 +334,16 @@ static int setup_memcaches(struct nss_ctx *nctx)
0ff280
                                   (time_t)memcache_timeout,
0ff280
                                   &nctx->initgr_mc_ctx);
0ff280
         if (ret) {
0ff280
-            DEBUG(SSSDBG_CRIT_FAILURE, "initgroups mmap cache is DISABLED\n");
0ff280
+            DEBUG(SSSDBG_CRIT_FAILURE,
0ff280
+                  "Failed to initialize initgroups mmap cache: '%s'\n",
0ff280
+                  sss_strerror(ret));
0ff280
+        } else {
0ff280
+            DEBUG(SSSDBG_CONF_SETTINGS, "Initgroups mmap cache size is %d\n",
0ff280
+                  mc_size_initgroups);
0ff280
         }
0ff280
+    } else {
0ff280
+        DEBUG(SSSDBG_IMPORTANT_INFO,
0ff280
+              "Initgroups mmap cache is explicitly DISABLED\n");
0ff280
     }
0ff280
 
0ff280
     return EOK;
0ff280
-- 
0ff280
2.21.3
0ff280