help-hurd
[Top][All Lists]
Advanced

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

Re: Reference counting in netfs


From: Thomas Bushnell, BSG
Subject: Re: Reference counting in netfs
Date: 06 Jan 2003 20:49:23 -0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Ludovic Courtès <ludovic.courtes@utbm.fr> writes:

> Consider the following case which is what happens when using "rm".  On the
> client side (rm), the program takes the following steps when typing "rm x":
>   1. lookup "."
>   2. lookup "x"
>   3. close x (ie. mach_port_deallocate () the above port)
>   4. unlink "x".
> On the server side, the successful lookup of "x" adds a reference to the
> corresponding node which is then dropped when the client closes it.
> 
> However, when my netfs_attempt_unlink () is called and has locked the
> refcnt spin lock, it turns out that the reference has not been dropped yet.
> Since the number of references to the node is greater than 1, it will just
> return EBUSY.

This is incorrect behavior for netfs_attempt_unlink.  There is nothing
wrong with unlinking a node that still has other references, and if
this is done, you must not actually free any storage until all the
references go away.  (That is, other users that have the file open
must have it continue to work as before.)







reply via email to

[Prev in Thread] Current Thread [Next in Thread]