Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Sep 2012 03:36:58 +0000 (UTC)
From:      Tai-hwa Liang <avatar@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r239999 - stable/9/sys/gnu/fs/reiserfs
Message-ID:  <201209020336.q823awhq031546@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avatar
Date: Sun Sep  2 03:36:57 2012
New Revision: 239999
URL: http://svn.freebsd.org/changeset/base/239999

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/9/sys/gnu/fs/reiserfs/reiserfs_vfsops.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/gnu/fs/reiserfs/reiserfs_vfsops.c
==============================================================================
--- stable/9/sys/gnu/fs/reiserfs/reiserfs_vfsops.c	Sun Sep  2 01:48:47 2012	(r239998)
+++ stable/9/sys/gnu/fs/reiserfs/reiserfs_vfsops.c	Sun Sep  2 03:36:57 2012	(r239999)
@@ -227,7 +227,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);
 	g_topology_unlock();
 	PICKUP_GIANT();
 	vrele(rmp->rm_devvp);
@@ -611,7 +611,7 @@ out:
 	if (cp != NULL) {
 		DROP_GIANT();
 		g_topology_lock();
-		g_wither_geom_close(cp->geom, ENXIO);
+		g_vfs_close(cp);
 		g_topology_unlock();
 		PICKUP_GIANT();
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209020336.q823awhq031546>