898de37 Do not call gpm_grab_sock() twice

1 file Authored by simo 6 years ago, Committed by rharwood 6 years ago,
    Do not call gpm_grab_sock() twice
    
    In the gpm_get_ctx() call, we unnecessarily call gpm_grab_sock() which
    would cause the lock to be held by one thread and never released.  We
    already call gpm_grab_sock() as the first thing after gpm_get_ctx() in
    gpm_make_call(), plus gpm_make_call() properly releases the socket
    once done.
    
    This corrects the deadlock fix in
    461a5fa9f91a2753ebeef6323a64239c35e2f250, which incorrectly released
    the lock we wanted to grab.  This caused the socket to not be locked
    to our thread.  Another thread could come along and change the global
    ctx while we were still using the socket from another thread, causing
    concurrency issues as only one request can be in flight on any given
    socket at the same time.
    
    In special cases where the "thread" uid/gid changes (like in
    rpc.gssd), we end up closing the socket while we are still waiting for
    an answer from the server, causing additional issues and confusion.
    
    [rharwood@redhat.com: squashed 2 commits; minor edits accordingly]
    Signed-off-by: Simo Sorce <simo@redhat.com>
    Reviewed-by: Robbie Harwood <rharwood@redhat.com>
    Merges: #218
    Signed-off-by: Robbie Harwood <rharwood@redhat.com>
    
        
file modified
+3 -6