From: Jörn Engel (joern_at_wohnheim.fh-wedel.de)
Date: Wed 27 Oct 2004 - 18:47:02 BST
On Thu, 14 October 2004 14:16:14 +0200, Jörn Engel wrote:
> This, btw, brings us to the worst part of cowlinks. Take this simple
> example, using your enhanced ascii art. ;)
> C1 ---,-> I1
> C2 --´
> A program has this example pseudo-code:
> 1: fd1 = open(C2, ro);
> 2: fd2 = open(C2, rw);
> 3: write(fd2, "foo");
> 4: fd3 = open(C1, rw);
> 5: write(fd3, "bar");
> 6: read(fd1, ...);
Carsten Otte just proved to me that this is a non-issue. The same
behaviour can be triggered without cowlinks as well.
H1 ---,-> I1
1: fd1 = open(H2, ro);
2: fd2 = open(H2, rw);
3: write(fds, "foo");
4: fd3 = open(H1, rw);
5: write(fd3, "bar");
6: read(fd1, ...);
2a and 2b cause this strange behaviour, but that's perfectly fine and
expected, once you think about it. In fact, userspace is by
definition racy and 2a and 2b can even be done by a different program.
Therefore, no matter how much complexity we put into cowlinks, the
same problem still exists and userspace just has to deal with it.
So this is good news. Open for cowlinks will behave just as open for
any file - it will link the current inode to the fd and any further
operations on the fd deal with whatever was opened _at that time_. If
a cow causes that to be different - tough luck.
Next funny corner-case would be this fstat. If anyone has ideas how
to deal with this more gracefully than -EFAULT, I'm interested.
-- Geld macht nicht glücklich. Glück macht nicht satt. _______________________________________________ Vserver mailing list Vserver_at_list.linux-vserver.org http://list.linux-vserver.org/mailman/listinfo/vserver