[OpenAFS-devel] CheckHost patch version 2

Jim Rees rees@umich.edu
Mon, 21 Nov 2005 15:29:47 -0500


This version drops host locks in MultiBreakCallBackAlternateAddress_r and
MultiProbeAlternateAddress_r around the rpc.  The former of these had been
called with the host sometimes locked and sometimes not, so I fixed that.

The lock order is even stranger than I thought.  The host lock is always
acquired first, not the H_LOCK.  But this is done through the following
magic:

int
h_Lock_r(register struct host *host)
{
    H_UNLOCK;
    h_Lock(host);
    H_LOCK;
    return 0;
}

So you must acquire H_LOCK first, which is then immediately dropped.  And
you can't hold the host lock without also holding H_LOCK, at least not using
the current macros.  I suspect this may have been done at some time in the
distant past to try to fix some lock order reversals.

Please try this patch and let me know what happens.  It's against 1.4.0.

/afs/umich.edu/user/r/e/rees/pub/my-1121.diff