Author: pjd
Date: Thu Nov 24 07:25:43 2011
New Revision: 227923
URL: http://svn.freebsd.org/changeset/base/227923

Log:
  MFC r227110,r227111:
  
  r227110:
  
  In zvol_open() if the spa_namespace_lock is already held, it means that
  ZFS is trying to open and taste ZVOL as its VDEV. This is not supported,
  so return an error instead of panicing on spa_namespace_lock recursion.
  
  Reported by:  Robert Millan <r...@debian.org>
  PR:           kern/162008
  
  r227111:
  
  Correct typo in comment.
  
  Reported by:  Fabian Keil <f...@fabiankeil.de>
  
  Approved by:  re (kib)

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
==============================================================================
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c      Thu Nov 
24 06:27:47 2011        (r227922)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c      Thu Nov 
24 07:25:43 2011        (r227923)
@@ -875,6 +875,14 @@ zvol_open(struct g_provider *pp, int fla
        zvol_state_t *zv;
        int err = 0;
 
+       if (MUTEX_HELD(&spa_namespace_lock)) {
+               /*
+                * If the spa_namespace_lock is being held, it means that ZFS
+                * is trying to open ZVOL as its VDEV. This is not supported.
+                */
+               return (EOPNOTSUPP);
+       }
+
        mutex_enter(&spa_namespace_lock);
 
        zv = pp->private;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to