Bjorn Leffler has uploaded this change for review.
Initialise export_opt_lock statically
nfsd is built from MainNFSD/nfs_main.c, which never calls
PTHREAD_RWLOCK_init() on export_opt_lock -- only the library entry point
nfs_lib.c does -- yet export_defaults_commit() write-locks it while reading
exports.
A zeroed pthread_rwlock_t happens to be a valid unlocked lock on glibc, so
this goes unnoticed there. It is not guaranteed by POSIX, and pthread
implementations that validate the lock reject it:
export_defaults_commit :RW LOCK :CRIT :Error 22, write locking
PTHREAD_RWLOCK_INITIALIZER is all-zero on glibc, so the generated code is
unchanged there.
Change-Id: Iee1852e724fb8788abd01bcb05dc9ac7f4176625
Signed-off-by: Bjorn Leffler <github@leffler.org>
---
M src/support/exports.c
1 file changed, 6 insertions(+), 1 deletion(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/65/1246765/1
To view, visit change 1246765. To unsubscribe, or for help writing mail filters, visit settings.