final decision about *at syscalls
Pawel Jakub Dawidek
pjd at FreeBSD.org
Wed Apr 16 16:56:38 UTC 2008
On Wed, Apr 16, 2008 at 10:14:40AM -0400, John Baldwin wrote:
> On Saturday 12 April 2008 07:20:19 am Pawel Jakub Dawidek wrote:
> > From what you write John, #1 is a better choice than #2. If you want to
> > avoid races, you can pass already locked vnode. In case of file
> > descriptors, if p_fd is not locked another thread can close and open
> > different directory under the same descriptor number.
>
> Did you read Robert's paper? Do you not realize that the kernel copying data
> in from userland multiple times and having it change in between is very bug
> prone?
Believe me I'm fully aware of the problems Robert described in his
paper. With vnode approach where do you have more data copying between
kernel and userland?
File descriptor proposal works like this:
userland
openat(fd, path)
kernel
NDINIT_AT(&vp, path, fd);
/* operate on vp */
Vnode proposal works this way:
userland
openat(fd, path)
kernel
dvp = file_descriptor_to_vnode(fd);
NDINIT_AT(&vp, path, dvp);
/* operate on vp */
--
Pawel Jakub Dawidek http://www.wheel.pl
pjd at FreeBSD.org http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20080416/9fd48af0/attachment.pgp
More information about the freebsd-arch
mailing list