Move VFS_EXTATTRCTL to mount_domount(). This makes the

fs/puffs/t_fuzz:mountfuzz7, fs/puffs/t_fuzz:mountfuzz8,
and fs/zfs/t_zpool:create tests pass again.  Patch from
manu, discussed on tech-kern and committed at his request.
This commit is contained in:
gson 2012-05-08 08:44:49 +00:00
parent 8b2ecf848a
commit 425e23f1fe
2 changed files with 13 additions and 24 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_mount.c,v 1.13 2012/03/13 18:40:55 elad Exp $ */
/* $NetBSD: vfs_mount.c,v 1.14 2012/05/08 08:44:49 gson Exp $ */
/*-
* Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.13 2012/03/13 18:40:55 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.14 2012/05/08 08:44:49 gson Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -83,6 +83,7 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.13 2012/03/13 18:40:55 elad Exp $");
#include <sys/module.h>
#include <sys/mount.h>
#include <sys/namei.h>
#include <sys/extattr.h>
#include <sys/syscallargs.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
@ -739,8 +740,15 @@ mount_domount(struct lwp *l, vnode_t **vpp, struct vfsops *vfsops,
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) {
error = VFS_EXTATTRCTL(vp->v_mountedhere,
EXTATTR_CMD_START, NULL, 0, NULL);
if (error)
printf("%s: failed to start extattr: error = %d\n",
vp->v_mountedhere->mnt_stat.f_mntonname, error);
}
/* Drop reference held for VFS_START(). */
vfs_destroy(mp);
*vpp = NULL;

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_syscalls.c,v 1.455 2012/05/02 20:48:29 rmind Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.456 2012/05/08 08:44:49 gson Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.455 2012/05/02 20:48:29 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.456 2012/05/08 08:44:49 gson Exp $");
#ifdef _KERNEL_OPT
#include "opt_fileassoc.h"
@ -458,30 +458,11 @@ do_sys_mount(struct lwp *l, struct vfsops *vfsops, const char *type,
} else if (flags & MNT_UPDATE) {
error = mount_update(l, vp, path, flags, data_buf, &data_len);
} else {
struct vnode *svp;
/* Save vp as mount_domount sets it to NULL */
vref(vp);
svp = vp;
/* Locking is handled internally in mount_domount(). */
KASSERT(vfsopsrele == true);
error = mount_domount(l, &vp, vfsops, path, flags, data_buf,
&data_len);
vfsopsrele = false;
if ((error == 0) && (flags & MNT_EXTATTR)) {
KASSERT(svp->v_mountedhere != NULL);
if (VFS_EXTATTRCTL(svp->v_mountedhere,
EXTATTR_CMD_START,
NULL, 0, NULL) != 0)
printf("%s: failed to start extattr",
svp->v_mountedhere->mnt_stat.f_mntonname);
/* XXX remove flag */
}
vrele(svp);
}
done: