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

看板DFBSD_submit作者時間21年前 (2004/04/21 12:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串4/17 (看更多)
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
文章代碼(AID): #10XV8900 (DFBSD_submit)
討論串 (同標題文章)
文章代碼(AID): #10XV8900 (DFBSD_submit)