[patch] POSIX advisory mode lock panic fix by Dfly

Matthew Dillon dillon at apollo.backplane.com
Tue Apr 20 12:42:57 PDT 2004


:>       integrated into the lockf structure allocation and deallocation
:>       functions).
:
:Well, the number of locks needs to be kept track of on a per-process 
:level as well for possible setuid() transfers. I think that passing a 
:struct lockf * is a good idea; but it's not moot unless the process 
:count is upgraded in the lf_alloc() instead of in chgposixlockcnt() (but 
:I don't think that's very clean, is it?)

    Sometimes these things just fall into place, other times they are
    predetermined to be ugly no matter what you do :-).

    If its going to be ugly it is best to put the ugliness all in one place.
    So, for example, it is generally better to pass the governing structure 
    to a wrapper procedure with ugly insides then it is to strew 'pp' all over
    the source file.  Sometimes special cases prevent it from working out,
    and sometimes things just fall into place and you get an elegant solution.

						-Matt





More information about the Submit mailing list