Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/kern/vfs_mount.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/kern/vfs_mount.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.12.6.2 retrieving revision 1.13 diff -u -p -r1.12.6.2 -r1.13 --- src/sys/kern/vfs_mount.c 2014/12/04 05:38:54 1.12.6.2 +++ src/sys/kern/vfs_mount.c 2012/03/13 18:40:55 1.13 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_mount.c,v 1.12.6.2 2014/12/04 05:38:54 snj Exp $ */ +/* $NetBSD: vfs_mount.c,v 1.13 2012/03/13 18:40:55 elad Exp $ */ /*- * Copyright (c) 1997-2011 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.12.6.2 2014/12/04 05:38:54 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.13 2012/03/13 18:40:55 elad Exp $"); #include #include @@ -83,7 +83,6 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_mount.c, #include #include #include -#include #include #include #include @@ -637,29 +636,12 @@ mount_checkdirs(vnode_t *olddp) vput(newdp); } -/* - * Start extended attributes - */ -static int -start_extattr(struct mount *mp) -{ - int error; - - error = VFS_EXTATTRCTL(mp, EXTATTR_CMD_START, NULL, 0, NULL); - if (error) - printf("%s: failed to start extattr: error = %d\n", - mp->mnt_stat.f_mntonname, error); - - return error; -} - int mount_domount(struct lwp *l, vnode_t **vpp, struct vfsops *vfsops, const char *path, int flags, void *data, size_t *data_len) { vnode_t *vp = *vpp; struct mount *mp; - struct vattr va; struct pathbuf *pb; struct nameidata nd; int error; @@ -677,24 +659,6 @@ mount_domount(struct lwp *l, vnode_t **v return ENOTDIR; } - /* - * If the user is not root, ensure that they own the directory - * onto which we are attempting to mount. - */ - vn_lock(vp, LK_SHARED | LK_RETRY); - error = VOP_GETATTR(vp, &va, l->l_cred); - VOP_UNLOCK(vp); - if (error != 0) { - vfs_delref(vfsops); - return error; - } - if ((va.va_uid != kauth_cred_geteuid(l->l_cred) && - (error = kauth_authorize_generic(l->l_cred, - KAUTH_GENERIC_ISSUSER, NULL)) != 0)) { - vfs_delref(vfsops); - return error; - } - if (flags & MNT_EXPORTED) { vfs_delref(vfsops); return EINVAL; @@ -775,11 +739,8 @@ mount_domount(struct lwp *l, vnode_t **v vfs_unbusy(mp, true, NULL); (void) VFS_STATVFS(mp, &mp->mnt_stat); error = VFS_START(mp, 0); - if (error) { + if (error) vrele(vp); - } else if (flags & MNT_EXTATTR) { - (void)start_extattr(mp); - } /* Drop reference held for VFS_START(). */ vfs_destroy(mp); *vpp = NULL; @@ -814,7 +775,7 @@ int dounmount(struct mount *mp, int flags, struct lwp *l) { vnode_t *coveredvp; - int error, async, used_syncer, used_extattr; + int error, async, used_syncer; #if NVERIEXEC > 0 error = veriexec_unmountchk(mp); @@ -835,7 +796,6 @@ dounmount(struct mount *mp, int flags, s } used_syncer = (mp->mnt_syncer != NULL); - used_extattr = mp->mnt_flag & MNT_EXTATTR; /* * XXX Syncer must be frozen when we get here. This should really @@ -874,12 +834,6 @@ dounmount(struct mount *mp, int flags, s rw_exit(&mp->mnt_unmounting); if (used_syncer) mutex_exit(&syncer_mutex); - if (used_extattr) { - if (start_extattr(mp) != 0) - mp->mnt_flag &= ~MNT_EXTATTR; - else - mp->mnt_flag |= MNT_EXTATTR; - } return (error); } vfs_scrubvnlist(mp);