On Thu, May 03, 2001 at 06:03:07PM -0700, Jeremy Allison wrote:
> The only thing we need to fix (IMHO) is the close(dup(fd)) "bug",
> which I have yet to see any application treat as anything other
> than a spec. bug that must be worked around.
I don't think it's a bug right now; not dropping them and keeping them
around forever adds a quite lot of new problems: just see how unnatural
sysv shared memory segments and semaphores fit into the rest of the mostly
elegant unix model. You need to have special administration tools for them,
you need to clean up after crashing applications that keep their resources
around, you need special global resource limits to avoid users running amok
etc. Persistent locks have similar problems. They probably can all be solved,
but it won't be pretty or easy.
One way to work around this would be to have a special device where these locks
are associated with an open descriptor. e.g. in samba you would open that
device (it would work like the /dev/ptmx multiplexer and just give new
instances for every open)
and remove close-on-exec and inherit it to every child. It would even work
for more distributed applications without clear child-parent relations, you
could pass that fd around via unix sockets. Then all persistent
locks would be associated with the fd. When samba dies all
references to that lock manager instance would be closed and the system could
clean up the persistent locks without administrator support. I think such
a scheme would be much nicer to the rest of the system and avoid the problems
the sysv stuff has.
Comments?
-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]