Matthew DeVore has uploaded this change for review.

View Change

Always initialize rwlock when creating acl object

In one call site for nfs4_acl_alloc, there was error handling for the
return of pthread_rwlock_init. I removed this I'm using
PTHREAD_RWLOCK_init which abort()s on error. The glibc and macOS
implementations of pthread_rwlock_init always return 0. See [0] and [1].

Initializing rwlock objects is critical in macOS, where unlike Linux,
operations on non-initialized rwlock objects result in error, and zero'd
out memory (as returned by calloc) is not considered a valid
initialization state.

[0] https://sourceware.org/git/?p=glibc.git;a=blob;f=nptl/pthread_rwlock_init.c;h=c0aa194107429588f0c84a7d4ffdf28930dd1b0b;hb=HEAD
[1] https://opensource.apple.com/source/libpthread/libpthread-454.120.2/src/pthread_rwlock.c.auto.html

Signed-off-by: Matthew DeVore <matvore@google.com>
Change-Id: I802d9bd696979a6801e5ab8a70a0021ed6918720
---
M src/support/nfs4_acls.c
1 file changed, 7 insertions(+), 14 deletions(-)

git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/77/526277/1

To view, visit change 526277. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: I802d9bd696979a6801e5ab8a70a0021ed6918720
Gerrit-Change-Number: 526277
Gerrit-PatchSet: 1
Gerrit-Owner: Matthew DeVore <me@matvore.com>
Gerrit-MessageType: newchange