DragonFly BSD
DragonFly submit List (threaded) for 2004-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: [patch] POSIX advisory mode lock panic fix by Dfly


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 20 Apr 2004 10:21:37 -0700 (PDT)

: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
:ftp://dragonflybsd.dyndns.org/posix-locks.diff
:
:I hope someone else can review it :)
:
:Joerg

    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.

					-Matt
					Matthew Dillon 
					<dillon@xxxxxxxxxxxxx>



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]