Date: Wed, 18 Mar 2009 18:38:26 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r189975 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb fs/cd9660 Message-ID: <200903181838.n2IIcQAp034183@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Wed Mar 18 18:38:26 2009 New Revision: 189975 URL: http://svn.freebsd.org/changeset/base/189975 Log: MFC: Keep the vnode for the mountpoint locked on return from namei() until after g_vfs_open() to match other filesystems. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/fs/cd9660/cd9660_vfsops.c Modified: stable/7/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- stable/7/sys/fs/cd9660/cd9660_vfsops.c Wed Mar 18 18:30:00 2009 (r189974) +++ stable/7/sys/fs/cd9660/cd9660_vfsops.c Wed Mar 18 18:38:26 2009 (r189975) @@ -154,14 +154,14 @@ cd9660_mount(struct mount *mp, struct th * Not an update, or updating the name: look up the name * and verify that it refers to a sensible block device. */ - NDINIT(&ndp, LOOKUP, FOLLOW, UIO_SYSSPACE, fspec, td); + NDINIT(&ndp, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, fspec, td); if ((error = namei(&ndp))) return (error); NDFREE(&ndp, NDF_ONLY_PNBUF); devvp = ndp.ni_vp; if (!vn_isdisk(devvp, &error)) { - vrele(devvp); + vput(devvp); return (error); } @@ -170,7 +170,6 @@ cd9660_mount(struct mount *mp, struct th * or has superuser abilities */ accessmode = VREAD; - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); error = VOP_ACCESS(devvp, accessmode, td->td_ucred, td); if (error) error = priv_check(td, PRIV_VFS_MOUNT_PERM); @@ -178,22 +177,20 @@ cd9660_mount(struct mount *mp, struct th vput(devvp); return (error); } - VOP_UNLOCK(devvp, 0, td); if ((mp->mnt_flag & MNT_UPDATE) == 0) { error = iso_mountfs(devvp, mp, td); + if (error) + vrele(devvp); } else { if (devvp != imp->im_devvp) error = EINVAL; /* needs translation */ - else - vrele(devvp); - } - if (error) { - vrele(devvp); - return error; + vput(devvp); } + if (error) + return (error); vfs_mountedfrom(mp, fspec); - return 0; + return (0); } /* @@ -224,7 +221,6 @@ iso_mountfs(devvp, mp, td) struct bufobj *bo; char *cs_local, *cs_disk; - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); DROP_GIANT(); g_topology_lock(); error = g_vfs_open(devvp, &cp, "cd9660", 0);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903181838.n2IIcQAp034183>