Subject: Re: Incorrect vattr passed to VOP_SYMLINK?
To: None <firstname.lastname@example.org>
From: Julio M. Merino Vidal <email@example.com>
Date: 08/16/2005 16:58:48
On 8/15/05, YAMAMOTO Takashi <firstname.lastname@example.org> wrote:
> > Yes, of course I can do that. I just wanted to avoid it because it see=
> > redundant if va_type also held the same value (which always does except
> > for this specific case).
> although i have no strong objection against your proposal,
> it seems that you are just moving the redundancy
> from your filesystem to VOP.
Well, I can agree that setting va_type to VLNK before calling VOP_SYMLINK
is redundant, because it will always have to hold that value. But consider=
for example, VOP_MKDIR. This one sets va_type to VDIR, which is redundant
too because that value can always be assumed.
OTOH, VOP_CREATE and VOP_MKNOD are different because they can
receive different va_type arguments. (E.g., the former accepts VREG and
VSOCK, while the later allows VBLK, VCHR and VFIFO).
So... I think we should either set the type to VLNK before calling
VOP_SYMLINK, thus being consistent across all possible calls, or unset
VDIR before calling VOP_MKDIR to avoid all redundancy. (Each of which
require careful examination of the file-systems to avoid problems.)
Julio M. Merino Vidal <email@example.com>
The NetBSD Project - http://www.NetBSD.org/