You're right - I did miss your point slightly, although I hope you agree
with what I did write. Especially that marking files for mandatory locking
is a serious issue and shouldn't be undertaken lightly.
I do have a couple of comments which may or may not be of interest/
relevance:
1) A critical daemon like nfsd should be coded as defensively as possibly.
No harm in nfsd noticing the group-id bit and checking for locks with
F_GETLK.
2) Opening files with O_NONBLOCK avoids blocking on mandatory locks.
Throw the patches out if you really. They probably won't be missed by many
people. I implemented them as a small personal challenge and for a sense
of completeness - but if its more trouble than its worth then okay, no
problem.
-Andy
P.S.
I still maintain that anybody turning on mandatory locking for a file
without considering the circumstances is getting exactly what they ask
for, but I'm not so blind that I can't see the situation with a horde
of students who just love such devilish experiments. If the system
utilities can't feasibly be bulletproofed in this respect then I suppose
the locks just have to go.
-- Andy Walker Kvaerner Engineering a.s. Andrew.Walker@lysaker.kvaerner.no P.O. Box 222, N-1324 Lysaker, Norway......if the answer isn't violence, neither is your silence......