From owner-svn-src-stable@freebsd.org Sat Oct 24 19:40:28 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AD27A1DEC9; Sat, 24 Oct 2015 19:40:28 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 523A111A4; Sat, 24 Oct 2015 19:40:28 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9OJeRfT039855; Sat, 24 Oct 2015 19:40:27 GMT (envelope-from avatar@FreeBSD.org) Received: (from avatar@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9OJeRhr039854; Sat, 24 Oct 2015 19:40:27 GMT (envelope-from avatar@FreeBSD.org) Message-Id: <201510241940.t9OJeRhr039854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avatar set sender to avatar@FreeBSD.org using -f From: Tai-hwa Liang Date: Sat, 24 Oct 2015 19:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r289889 - stable/7/sys/gnu/fs/reiserfs X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2015 19:40:28 -0000 Author: avatar Date: Sat Oct 24 19:40:27 2015 New Revision: 289889 URL: https://svnweb.freebsd.org/changeset/base/289889 Log: MFC r238980: Just like the other file systems found in /sys/fs, g_vfs_open() should be paried with g_vfs_close(). Though g_vfs_close() is a wrapper around g_wither_geom_close(), r206130 added the following test in g_vfs_open(): if (bo->bo_private != vp) return (EBUSY); Which will cause a 'Device busy' error inside reiserfs_mountfs() if the same file system is re-mounted again after umount or mounting failure: (case 1, /dev/ad4s3 is not a valid REISERFS partition) # mount -t reiserfs -o ro /dev/ad4s3 /mnt mount: /dev/ad4s3: Invalid argument # mount -t msdosfs -o ro /dev/ad4s3 /mnt mount: /dev/ad4s3: Device busy (case 2, /dev/ad4s3 is a valid REISERFS partition) # mount -t reiserfs -o ro /dev/ad4s3 /mnt # umount /mnt # mount -t reiserfs -o ro /dev/ad4s3 /mnt mount: /dev/ad4s3: Device busy On the other hand, g_vfs_close() 'fixed' the above cases by doing an extra step to keep 'sc->sc_bo->bo_private' and 'cp->private' pointers synchronised. Reviewed by: kib Modified: stable/7/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/gnu/fs/reiserfs/reiserfs_vfsops.c ============================================================================== --- stable/7/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Sat Oct 24 19:40:03 2015 (r289888) +++ stable/7/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Sat Oct 24 19:40:27 2015 (r289889) @@ -223,7 +223,7 @@ reiserfs_unmount(struct mount *mp, int m DROP_GIANT(); g_topology_lock(); - g_wither_geom_close(rmp->rm_cp->geom, ENXIO); + g_vfs_close(rmp->rm_cp, td); g_topology_unlock(); PICKUP_GIANT(); vrele(rmp->rm_devvp); @@ -635,7 +635,7 @@ out: if (cp != NULL) { DROP_GIANT(); g_topology_lock(); - g_wither_geom_close(cp->geom, ENXIO); + g_vfs_close(cp, td); g_topology_unlock(); PICKUP_GIANT(); }