Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Sep 2002 16:38:09 -0700 (PDT)
From:      Nate Lawson <nate@root.org>
To:        phk@freebsd.org, des@freebsd.org
Cc:        arch@freebsd.org
Subject:   PATCH: vnode->v_tag to const char *
Message-ID:  <Pine.BSF.4.21.0209101629150.19569-100000@root.org>

next in thread | raw e-mail | index | archive | help
I have built and tested a patch that changes v_tag and all users of
it.  Since it should never be accessed other than for debugging, it is now
a const char *, set by the caller of getnewvnode(9).

There were a couple sticky points:

* kern_descrip.c - checks for procfs on 0/1/2 and disallows sugid
access.  Added flag VV_UNSAFE to v_vflag and set it in pseudofs when the
PFS_PROCDEP flag is sent to pfs_create_{file,dir,link}.  I changed procfs
to set this flag in each create call but a better approach might be to
set the flag if the parent has the flag set and thus the flag in the root
dir creation would get propagated to all.  des@, comments?

* kern/vfs_bio.c, vm/vm_swap.c - detecting NFS vnode is now done via:
     vp->v_mount->mnt_stat.f_type == nfs_mount_type
Since NFS does this itself, I'm guessing it's the accepted way.

* Bikeshed:  Quotes around printing v_tag?  Example:
isofs/cd9660/cd9660_vnops.c:
    printf("tag \"%s\", isofs vnode\n", ap->a_vp->v_tag);

Patch available (full build, tests ok for several fs types) at:
http://www.root.org/~nate/freebsd/

-Nate


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0209101629150.19569-100000>