Lou Gosselin:
> I tried to detect locked branches based on the paths as mentioned below.
> However I'm finding that the below algorithm does not reliably determine 
> the branch that a file lock is on.

As I wrote, there are some complicated cases in real world.


>  >mkdir union a b
>  >cp /bin/sh a
>  >cp /bin/sh b
>  >mount -t aufs aufs union -o br:a
>
> # From another shell
>  >union/sh
>
> # Original shell
>  >mount union -o remount,prepend:b
>
> # Now, the algorithm discussed tells us that the file lock for "sh" lock 
> is on "b", but it's not.
> # The manual confirms that mmap files don't change branches, which is 
> the case with executables.

You are misunderstanding.
When union/sh was invoked, there were only one branch in union and only
one real file "sh" in union. This only one real file was mmap-ed and
executed. The description in the manual means that the mmap-ed file on
the branch "a" will never be refreshed and changed to the branch "b".

Deleting a branch is very similar to unmounting a regular filesystem.
Once you run
# mount /dev/sda1 /mnt
You will not be able to unmount /mnt as long as any file is in-use in
/mnt. I hope you will understand that you can unmount /mnt if you are
running /mnt/sh.


J. R. Okajima

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm

Reply via email to