From owner-freebsd-arch Wed Sep 11 10:43:37 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 D749837B400; Wed, 11 Sep 2002 10:43:34 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8353E43E3B; Wed, 11 Sep 2002 10:43:33 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id DAA23769; Thu, 12 Sep 2002 03:43:28 +1000 Date: Thu, 12 Sep 2002 03:43:20 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Nate Lawson Cc: phk@FreeBSD.ORG, , Subject: Re: PATCH: vnode->v_tag to const char * In-Reply-To: Message-ID: <20020912033728.K3237-100000@gamplex.bde.org> 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 On Tue, 10 Sep 2002, Nate Lawson wrote: > 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? I like inheriting it. > * 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. I don't like this. I can't find where nfs does this now, but remember thinking that this method doesn't work in general because nfs's variable can only be referenced if nfs is loaded. > * Bikeshed: Quotes around printing v_tag? Example: > isofs/cd9660/cd9660_vnops.c: > printf("tag \"%s\", isofs vnode\n", ap->a_vp->v_tag); Quotes shouldn't be necessary since you can choose names without any spaces. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message