Madhu Thorat would like Malahal to review this change.

View Change

[GPFS] Fix to let GPFS upcall thread exit at ganesha startup

Currently during startup if GPFSFSAL_UP_Thread() gets called, it
waits in nfs_init_wait() for init to complete. But if during startup
gpfs_unclaim_filesystem() gets called, then the main thread may hang
at pthread_join() for GPFS upcall thread, if the thread is waiting in
nfs_init_wait().
To avoid this made use of 'stop_thread' variable in
'struct gpfs_filesystem', which is set to 'true' prior to calling
pthread_join() in gpfs_unclaim_filesystem(). Also made changes to
allow to pass timeout value to nfs_init_wait() which is now called
in GPFSFSAL_UP_Thread() in while(1) loop, and after nfs_init_wait()
completes if gpfs_fs->stop_thread==true then we return.

Change-Id: I8cdf193ce955cd7248104741927307974d8f0958
Signed-off-by: Madhu Thorat <madhu.punjabi@in.ibm.com>
Reviewed-by: Malahal Naineni <malahal@us.ibm.com>
---
M src/FSAL/FSAL_GPFS/export.c
M src/FSAL/FSAL_GPFS/fsal_up.c
M src/FSAL/FSAL_GPFS/gpfs_methods.h
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_lru.c
M src/MainNFSD/nfs_init.c
M src/include/nfs_init.h
6 files changed, 46 insertions(+), 9 deletions(-)

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

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

Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: I8cdf193ce955cd7248104741927307974d8f0958
Gerrit-Change-Number: 495993
Gerrit-PatchSet: 1
Gerrit-Owner: Madhu Thorat <madhu.punjabi@in.ibm.com>
Gerrit-Reviewer: Malahal <malahal@gmail.com>
Gerrit-MessageType: newchange