Weirdness when writing to pseudofs file

Conrad Meyer cem at freebsd.org
Wed May 22 22:08:20 UTC 2019


On Wed, May 22, 2019 at 1:58 PM Johannes Lundberg <johalun at freebsd.org> wrote:
> > It seems, a single '>' will cause it to try to create the file (even
> > though it already exists) and that fails (kern_openat).
> >
> I would guess because of
>
> https://github.com/freebsd/freebsd/blob/master/sys/fs/pseudofs/pseudofs_vnops.c#L1042
>
> struct vop_vector pfs_vnodeops = {
> ...
> .vop_create = VOP_EOPNOTSUPP,
> ...
> }

kern_openat -> vn_open(_cred) should only call VOP_CREATE if namei()
cannot find the named vnode (ni_vp == NULL).  Otherwise, it should
just invoke VOP_OPEN.  This suggests there might be a lookup bug in
pfs?  Tracing VOPs as Mark suggested seems like a good next step.

Best,
Conrad


More information about the freebsd-current mailing list