ctdb-scripts: Do not "correct" number of nfsd threads when it is 0
authorMartin Schwenke <martin@meltin.net>
Tue, 26 Mar 2019 03:15:33 +0000 (14:15 +1100)
committerMartin Schwenke <martins@samba.org>
Sun, 31 Mar 2019 11:47:44 +0000 (11:47 +0000)
While 0 may indicate that all threads have exited after being stuck,
it may also indicate that nfsd should not be running due to being shut
down.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@samba.org>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Sun Mar 31 11:47:44 UTC 2019 on sn-devel-144

ctdb/config/nfs-linux-kernel-callout

index def69a04649aa27877f953ae30b580f05db47e3d..868f3279cf23d5cc95902c5d2fcd73c64ef68c98 100755 (executable)
@@ -313,8 +313,10 @@ nfs_check_thread_count ()
 
     # Intentionally not arithmetic comparison - avoids extra errors
     # when above read fails in an unexpected way...
-    if [ "$_running_threads" != "$_configured_threads" ] ; then
-       echo "Attempting to correct number of nfsd threads from ${_running_threads} to ${_configured_threads}"
+    if [ "$_running_threads" != "0" ] && \
+              [ "$_running_threads" != "$_configured_threads" ] ; then
+       printf 'Attempting to correct number of nfsd threads from %s to %s\n' \
+              "$_running_threads" "$_configured_threads"
        echo "$_configured_threads" >"$_threads_file"
     fi
 }