[patch] POSIX advisory mode lock panic fix by Dfly

Matthew Dillon dillon at apollo.backplane.com
Tue Apr 20 10:21:48 PDT 2004

:Beside some typos, this fix provides a very persimistic solution and makes
:locking/unlocking impossible in a few cases, were the lock counter doesn't
:have to be increased.
:I have an optimistic fix for the same problem at
:I hope someone else can review it :)

    Ok, I like this a lot better.  But I have the same issue with it as I
    had with the Devon's code...  the MALLOC() and free() operations are
    tightly associated with the lock count operations, so encapsulate 
    the MALLOC() into its own function, say lf_alloc(), and the free() into
    its own function, say, lf_free(), and have *these* functions also deal
    with the resource counter.

    (and pass the lock flags into lf_alloc() so it can check F_POSIX).

    Also, the error checking should not be integrated into chgposixlockcnt().
    That is, the resource counter increment/decrement should be unconditional
    based on the allocation and freeing of the related structures.  The
    resource limit should be checked in the main switch, with a special case
    in the case of a split.

					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>

More information about the Submit mailing list