From owner-svn-src-head@FreeBSD.ORG Thu Jan 29 16:47:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B90C2106568F; Thu, 29 Jan 2009 16:47:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7C1D8FC18; Thu, 29 Jan 2009 16:47:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0TGlFR3058777; Thu, 29 Jan 2009 16:47:15 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0TGlFHZ058776; Thu, 29 Jan 2009 16:47:15 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200901291647.n0TGlFHZ058776@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 29 Jan 2009 16:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187894 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jan 2009 16:47:16 -0000 Author: trasz Date: Thu Jan 29 16:47:15 2009 New Revision: 187894 URL: http://svn.freebsd.org/changeset/base/187894 Log: Make sure the cdev doesn't go away while the filesystem is still mounted. Otherwise dev2udev() could return garbage. Reviewed by: kib Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Thu Jan 29 16:18:49 2009 (r187893) +++ head/sys/ufs/ffs/ffs_vfsops.c Thu Jan 29 16:47:15 2009 (r187894) @@ -641,6 +641,7 @@ ffs_mountfs(devvp, mp, td) VOP_UNLOCK(devvp, 0); if (error) return (error); + dev_ref(dev); if (devvp->v_rdev->si_iosize_max != 0) mp->mnt_iosize_max = devvp->v_rdev->si_iosize_max; if (mp->mnt_iosize_max > MAXPHYS) @@ -921,6 +922,7 @@ out: free(ump, M_UFSMNT); mp->mnt_data = NULL; } + dev_rel(dev); return (error); } @@ -1107,6 +1109,7 @@ ffs_unmount(mp, mntflags, td) g_topology_unlock(); PICKUP_GIANT(); vrele(ump->um_devvp); + dev_rel(ump->um_dev); mtx_destroy(UFS_MTX(ump)); if (mp->mnt_gjprovider != NULL) { free(mp->mnt_gjprovider, M_UFSMNT);