Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Sep 2002 13:51:54 -0700 (PDT)
From:      Nate Lawson <nate@root.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        phk@FreeBSD.ORG, des@FreeBSD.ORG, arch@FreeBSD.ORG
Subject:   Re: PATCH: vnode->v_tag to const char *
Message-ID:  <Pine.BSF.4.21.0209111342510.22368-100000@root.org>
In-Reply-To: <20020912033728.K3237-100000@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 12 Sep 2002, Bruce Evans wrote:
> On Tue, 10 Sep 2002, Nate Lawson wrote:
> > 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.

Ok, I will change things so that it will be inherited from the parent.  
This is good since it will mean no changes to procfs code (only pseudofs)
since the root dir for procfs is created with PFS_PROCDEP in the existing
code (although for different reasons).
 
> > * 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.

Here are the current places that reference nfs_mount_type:

kern/vfs_subr.c:int     nfs_mount_type = -1;
sys/mount.h:extern int nfs_mount_type;  /* vfc_typenum for nfs, or -1 */
vm/vnode_pager.c:           (vp->v_mount->mnt_stat.f_type !=
nfs_mount_type)) {

As you can see, NFS does not need to be loaded and this var is already
ref'd in the vm code.  For vm_swap.c, the code is seeing if it is enabling
swapping to a file on an NFS-mounted fs, so v_mount has to be non-NULL.

The only other option I considered was checking v_op == nfsv2_vnodeop_p
but that has huge problems in that the vops for NFS are only present when
NFS is loaded.

If you have a better solution, I'm open to it.

> > * 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

Ok, thank you for your comments.

-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.0209111342510.22368-100000>