Subject: Incorrect vattr passed to VOP_SYMLINK?
To: None <>
From: Julio M. Merino Vidal <>
List: tech-kern
Date: 08/15/2005 00:24:05
Hi all,

while writing tmpfs' symlink vnode operation, I discovered that the
vattr argument it receives does not have a correct type set in it.
Other operations, such as the creation of files, directories, pipes
and devices have the corresponding type in vap->va_type.

I think the symlink operation should be consistent with all others
because this seems an unintended ommission.

Does anybody mind if I commit the patch shown below?  (This will
let me kill a workaround for this issue in tmpfs ;)


Index: sys/kern/vfs_syscalls.c
RCS file: /cvsroot/src/sys/kern/vfs_syscalls.c,v
retrieving revision 1.227
diff -u -r1.227 vfs_syscalls.c
--- vfs_syscalls.c      5 Aug 2005 13:22:23 -0000       1.227
+++ vfs_syscalls.c      14 Aug 2005 22:19:32 -0000
@@ -1659,6 +1659,7 @@
                goto restart;
+       vattr.va_type =3D VLNK;
        vattr.va_mode =3D ACCESSPERMS &~ p->p_cwdi->cwdi_cmask;
        VOP_LEASE(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
        error =3D VOP_SYMLINK(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr, pat=

Julio M. Merino Vidal <>
The NetBSD Project -