Subject: Re: Incorrect vattr passed to VOP_SYMLINK?
To: None <tech-kern@netbsd.org>
From: Julio M. Merino Vidal <jmmv84@gmail.com>
List: tech-kern
Date: 08/16/2005 16:58:48
On 8/15/05, YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp> wrote:
> > Yes, of course I can do that. I just wanted to avoid it because it see=
med
> > redundant if va_type also held the same value (which always does except
> > for this specific case).
>=20
> 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.)
--=20
Julio M. Merino Vidal <jmmv84@gmail.com>
http://www.livejournal.com/users/jmmv/
The NetBSD Project - http://www.NetBSD.org/