Fix DisplayLogComponentLevel recursion with NIV_FULL_DEBUG

If ganesha is started with NIV_FULL_DEBUG, DisplayLogComponentLevel
calls PTHREAD_RWLOCK_xxx() functions which call DisplayLogComponentLevel
to log messages. This continues in a loop until segmentation fault
happens!  A regression introduced by commit
344de4ab632713145194e936a8fb3568b9538321

Redefine PTHREAD_RWLOCK_xxx macros in logging file to avoid logging
inside PTHREAD_RWLOCK_xxx macros.

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Reported-by: Soumya Koduri <skoduri@redhat.com>
Reviewed-by: Frank S. Filz <ffilzlnx@mindspring.com>
Fix errno 34 (ERANGE) with getgrouplist() call

The first getgrouplist call with 0 ngroups returns -1 as the man page
says, but errno was set to 34 (instead of 0) under some environments.
The man page doesn't talk about errno with regards to getgrouplist call.
It did set the ngroups to the expected value!

Removed the errno check with getgrouplist call. The code assumes that
ngroups is set correctly no matter what the errno value is.

Reported-by: John Dorfner <dorfner@us.ibm.com>
Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Acked-by: Jim Lieb <jlieb@panasas.com>
Reviewed-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Acked-by: Frank S. Filz <ffilzlnx@mindspring.com>
Fix getgrouplist race

We make first getgrouplist() call with 0 ngroups to get the number of
groups the user is in. We then make the second call with just enough
memory to hold returned ngroups from the first call. If someone adds the
user to a new group between those two calls, both calls will fail!

This commit adds a third call with the largest ngroups we support (1000)
to make the third call. We resize the buffer after the call to just fit
the returned ngroups.

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Reviewed-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Acked-by: Frank S. Filz <ffilzlnx@mindspring.com>
CID30206: fix locking issue in nfs41_foreach_client_callback
Need to asynchroniously invoke client callback to
avoid releasing lock while traversing the nsm client RBT tree.

Signed-off-by: Rong Zeng <rongzeng@us.ibm.com>