Skip to content

Commit

Permalink
ctdb-scripts: Do not "correct" number of nfsd threads when it is 0
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Amitay Isaacs <[email protected]>

Autobuild-User(master): Martin Schwenke <[email protected]>
Autobuild-Date(master): Sun Mar 31 11:47:44 UTC 2019 on sn-devel-144
  • Loading branch information
martin-schwenke authored and Martin Schwenke committed Mar 31, 2019
1 parent a2bd408 commit f1a1c30
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ctdb/config/nfs-linux-kernel-callout
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit f1a1c30

Please sign in to comment.