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: "Devon H. O'Dell" <dodell@xxxxxxxxxxxxxxx>
Date: Tue, 20 Apr 2004 21:53:09 +0200

Matthew Dillon wrote:
:> 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

Yeah, and if you strew pp all over the place, it smells bad, too.


lf_alloc() is going to have to be ugly, just because it needs to know about the process to pass to incposixlockcnt().

Thanks for this info, I'll have a modified sys patch soon.

--Devon



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