Date: Sat, 17 Apr 2010 12:01:50 +0000 (UTC) From: Andriy Gapon <avg@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: r206757 - stable/7/sys/geom Message-ID: <201004171201.o3HC1oBk049998@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Sat Apr 17 12:01:50 2010 New Revision: 206757 URL: http://svn.freebsd.org/changeset/base/206757 Log: MFC r206130: g_vfs_open: allow only one mount per device vnode Modified: stable/7/sys/geom/geom_vfs.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/geom/geom_vfs.c ============================================================================== --- stable/7/sys/geom/geom_vfs.c Sat Apr 17 11:57:41 2010 (r206756) +++ stable/7/sys/geom/geom_vfs.c Sat Apr 17 12:01:50 2010 (r206757) @@ -163,6 +163,10 @@ g_vfs_open(struct vnode *vp, struct g_co g_topology_assert(); *cpp = NULL; + bo = &vp->v_bufobj; + if (bo->bo_private != vp) + return (EBUSY); + pp = g_dev_getprovider(vp->v_rdev); if (pp == NULL) return (ENOENT); @@ -178,7 +182,7 @@ g_vfs_open(struct vnode *vp, struct g_co vnode_create_vobject(vp, pp->mediasize, curthread); VFS_UNLOCK_GIANT(vfslocked); *cpp = cp; - bo = &vp->v_bufobj; + cp->private = vp; bo->bo_ops = g_vfs_bufops; bo->bo_private = cp; bo->bo_bsize = pp->sectorsize; @@ -198,5 +202,6 @@ g_vfs_close(struct g_consumer *cp, struc gp = cp->geom; bo = gp->softc; bufobj_invalbuf(bo, V_SAVE, td, 0, 0); + bo->bo_private = cp->private; g_wither_geom_close(gp, ENXIO); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004171201.o3HC1oBk049998>