The following commit has been merged in the openafs-stable-1_8_x branch:
commit 6824d45c2ab83e52350c3f366e4cb6f1eb263088
Author: Kailas Zadbuke <[email protected]>
Date:   Wed Jun 3 15:44:08 2020 +0530

    util: Handle serverLogMutex lock across forks
    
    If a process forks when another thread has serverLogMutex locked, the
    child process inherits the locked serverLogMutex. This causes a deadlock
    when code in the child process tries to lock serverLogMutex, since we
    can never unlock serverLogMutex because the locking thread no longer
    exists. This can happen in the salvageserver, since the salvageserver
    locks serverLogMutex in different threads, and forks to handle salvage
    jobs.
    
    To avoid this deadlock, we register handlers using pthread_atfork()
    so that the serverLogMutex will be held during the fork. The fork will
    be blocked until the worker thread releases the serverLogMutex. Hence the
    serverLogMutex will be held until the fork is complete and it will be
    released in the parent and child threads.
    
    Thanks to Yadavendra Yadav([email protected]) for working with me
    on this issue.
    
    Reviewed-on: https://gerrit.openafs.org/14239
    Reviewed-by: Benjamin Kaduk <[email protected]>
    Tested-by: BuildBot <[email protected]>
    (cherry picked from commit e44d6441c8786fdaaa1fad1b1ae77704c12f7d60)
    
    Change-Id: I09c04c0bd99b10433857ccdaeb4ee6a4cd50f768
    Reviewed-on: https://gerrit.openafs.org/14283
    Tested-by: BuildBot <[email protected]>
    Reviewed-by: Kailas Zadbuke <[email protected]>
    Reviewed-by: Andrew Deason <[email protected]>
    Reviewed-by: Cheyenne Wills <[email protected]>
    Reviewed-by: Stephan Wiesand <[email protected]>

 src/util/serverLog.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

-- 
OpenAFS Master Repository
_______________________________________________
OpenAFS-cvs mailing list
[email protected]
https://lists.openafs.org/mailman/listinfo/openafs-cvs

Reply via email to