From owner-freebsd-arch Tue Sep 10 16:38:14 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D95B137B401 for ; Tue, 10 Sep 2002 16:38:12 -0700 (PDT) Received: from rootlabs.com (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id E912343E4A for ; Tue, 10 Sep 2002 16:38:07 -0700 (PDT) (envelope-from nate@rootlabs.com) Received: (qmail 19607 invoked by uid 1000); 10 Sep 2002 23:38:09 -0000 Date: Tue, 10 Sep 2002 16:38:09 -0700 (PDT) From: Nate Lawson To: phk@freebsd.org, des@freebsd.org Cc: arch@freebsd.org Subject: PATCH: vnode->v_tag to const char * Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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