On Tue, Feb 17, 2009 at 09:43:31PM -0800, Cy Schubert
wrote:> I got this panic after issuing reboot(8).
>
> FreeBSD 7.1-STABLE FreeBSD 7.1-STABLE #0: Tue Feb 17 19:29:23 PST 2009
> cy@cwsys:/export/obj/export/home/cy/test/test-stable7/sys/DEBUG i386
>
>
> FreeBSD/i386 (bob) (ttyd0)
>
> login: Feb 17 21:22:56 bob reboot: rebooted by root
> Feb 17 21:22:56 bob syslogd: exiting on signal 15
> Waiting (max 60 seconds) for system process `vnlru' to stop...done
> Waiting (max 60 seconds) for system process `syncer' to stop...
> Syncing disks, vnodes remaining...2 2 2 2 1 1 1 1 0 0 0 0 0 0 done
> Waiting (max 60 seconds) for system process `bufdaemon' to stop...done
> All buffers synced.
> panic: insmntque() failed: error 16
> cpuid = 0
> KDB: enter: panic
> [thread pid 1086 tid 100090 ]
> Stopped at kdb_enter_why+0x3a: movl $0,kdb_why
> db> bt
> Tracing pid 1086 tid 100090 td 0xc2bfd230
> kdb_enter_why(c087ef4a,c087ef4a,c2b1b5b4,ebf8da58,0,...) at
> kdb_enter_why+0x3a
> panic(c2b1b5b4,10,c2b24a40,ebf8da64,c38e6000,...) at panic+0x136
> gfs_file_create(84,c346d8a0,c342d5a0,c2b24a40,c346d8a0,...) at
> gfs_file_create+0x86
> gfs_dir_create(84,c346d8a0,c342d5a0,c2b24a40,0,...) at gfs_dir_create+0x2c
> zfsctl_mknode_snapdir(c346d8a0,c2b1b54f,275,25d,c3419520,...) at
> zfsctl_mknode_snapdir+0x53
> gfs_dir_lookup(c346d8a0,c2b21126,ebf8db74,c091521c,ebf8db38,...) at
> gfs_dir_lookup+0xd1
> zfsctl_root_lookup(c346d8a0,c2b21126,ebf8db74,0,0,...) at
> zfsctl_root_lookup+0xdc
> zfsctl_umount_snapshots(c342d5a0,80000,c3acb800,c3216844,0,...) at
> zfsctl_umount_snapshots+0x4e
> zfs_umount(c342d5a0,80000,c2bfd230,c2bfd230,c088a687,...) at
zfs_umount+0x53
> dounmount(c342d5a0,80000,c2bfd230,e26988ac,0,...) at dounmount+0x430
> vfs_unmountall(c087ed87,0,c087edeb,128,0,...) at vfs_unmountall+0x4e
> boot(c090b5d0,0,c087edeb,ab,ebf8dd2c,...) at boot+0x44f
> reboot(c2bfd230,ebf8dcfc,4,c0885aef,c08c38a8,...) at reboot+0x4b
> syscall(ebf8dd38) at syscall+0x2b3
> Xint0x80_syscall() at Xint0x80_syscall+0x20
> --- syscall (55, FreeBSD ELF32, reboot), eip = 0x280bc947, esp =
> 0xbfbfeb7c, ebp = 0xbfbfebb8 ---
> db>
>
> Forceably unmounting ZFS filesystems prior to issuing reboot(8) mitigates
> the panic.
The patch below would fix the problem, unless I mis-merged it.
Please note that I cannot test the patch myself, so I rely on ZFS
users testing before the commit.
Property changes on: .
___________________________________________________________________
Modified: svn:mergeinfo
Merged /head/sys:r182781,182824,182840
Property changes on: dev/cxgb
___________________________________________________________________
Modified: svn:mergeinfo
Merged /head/sys/dev/cxgb:r182781,182824,182840
Property changes on: dev/ath/ath_hal
___________________________________________________________________
Modified: svn:mergeinfo
Merged /head/sys/dev/ath/ath_hal:r182781,182824,182840
Property changes on: contrib/pf
___________________________________________________________________
Modified: svn:mergeinfo
Merged /head/sys/contrib/pf:r182781,182824,182840
Index: cddl/contrib/opensolaris/uts/common/fs/gfs.c
==================================================================---
cddl/contrib/opensolaris/uts/common/fs/gfs.c (revision 188748)
+++ cddl/contrib/opensolaris/uts/common/fs/gfs.c (working copy)
@@ -358,6 +358,7 @@
fp = kmem_zalloc(size, KM_SLEEP);
error = getnewvnode("zfs", vfsp, ops, &vp);
ASSERT(error == 0);
+ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread);
vp->v_data = (caddr_t)fp;
/*
@@ -368,7 +369,9 @@
fp->gfs_size = size;
fp->gfs_type = GFS_FILE;
+ vp->v_vflag |= VV_FORCEINSMQ;
error = insmntque(vp, vfsp);
+ vp->v_vflag &= ~VV_FORCEINSMQ;
KASSERT(error == 0, ("insmntque() failed: error %d", error));
/*
Index: cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
==================================================================---
cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c (revision 188748)
+++ cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c (working copy)
@@ -113,6 +113,7 @@
if (cdrarg != NULL) {
error = getnewvnode("zfs", vfsp, &zfs_vnodeops, &vp);
ASSERT(error == 0);
+ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread);
zp->z_vnode = vp;
vp->v_data = (caddr_t)zp;
vp->v_vnlock->lk_flags |= LK_CANRECURSE;
@@ -348,7 +349,9 @@
if (vp == NULL)
return (zp);
+ vp->v_vflag |= VV_FORCEINSMQ;
error = insmntque(vp, zfsvfs->z_vfs);
+ vp->v_vflag &= ~VV_FORCEINSMQ;
KASSERT(error == 0, ("insmntque() failed: error %d", error));
vp->v_type = IFTOVT((mode_t)zp->z_phys->zp_mode);
@@ -535,8 +538,10 @@
*zpp = zp;
} else {
- if (ZTOV(zp) != NULL)
+ if (ZTOV(zp) != NULL) {
ZTOV(zp)->v_count = 0;
+ VOP_UNLOCK(ZTOV(zp), 0, curthread);
+ }
dmu_buf_rele(dbp, NULL);
zfs_znode_free(zp);
}
@@ -598,14 +603,18 @@
&zp->z_vnode);
ASSERT(err == 0);
vp = ZTOV(zp);
+ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread);
vp->v_data = (caddr_t)zp;
vp->v_vnlock->lk_flags |= LK_CANRECURSE;
vp->v_vnlock->lk_flags &= ~LK_NOSHARE;
vp->v_type = IFTOVT((mode_t)zp->z_phys->zp_mode);
if (vp->v_type == VDIR)
zp->z_zn_prefetch = B_TRUE; /* z_prefetch default is enabled */
+ vp->v_vflag |= VV_FORCEINSMQ;
err = insmntque(vp, zfsvfs->z_vfs);
+ vp->v_vflag &= ~VV_FORCEINSMQ;
KASSERT(err == 0, ("insmntque() failed: error %d", err));
+ VOP_UNLOCK(vp, 0, curthread);
}
mutex_exit(&zp->z_lock);
ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num);
@@ -621,6 +630,8 @@
zfs_znode_dmu_init(zp);
ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num);
*zpp = zp;
+ if ((vp = ZTOV(zp)) != NULL)
+ VOP_UNLOCK(vp, 0, curthread);
return (0);
}
Index: cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==================================================================---
cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c (revision 188748)
+++ cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c (working copy)
@@ -1303,12 +1303,6 @@
}
}
out:
-
- if (error == 0) {
- *vpp = ZTOV(zp);
- vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, td);
- }
-
if (dl)
zfs_dirent_unlock(dl);
@@ -1588,8 +1582,6 @@
zfs_log_create(zilog, tx, TX_MKDIR, dzp, zp, dirname);
dmu_tx_commit(tx);
- vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, curthread);
-
zfs_dirent_unlock(dl);
ZFS_EXIT(zfsvfs);
@@ -2773,7 +2765,6 @@
if (error == 0) {
zfs_log_symlink(zilog, tx, TX_SYMLINK, dzp, zp, name, link);
*vpp = ZTOV(zp);
- vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, td);
}
dmu_tx_commit(tx);
Index: cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==================================================================---
cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c (revision 188748)
+++ cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c (working copy)
@@ -176,6 +176,8 @@
vp->v_vflag &= ~VV_ROOT;
zfsvfs->z_ctldir = vp;
+
+ VOP_UNLOCK(vp, 0, curthread);
}
/*
@@ -789,6 +791,7 @@
mutex_init(&sdp->sd_lock, NULL, MUTEX_DEFAULT, NULL);
avl_create(&sdp->sd_snaps, snapentry_compare,
sizeof (zfs_snapentry_t), offsetof(zfs_snapentry_t, se_node));
+ VOP_UNLOCK(vp, 0, curthread);
return (vp);
}
@@ -862,6 +865,7 @@
&zfsctl_ops_snapshot, NULL, NULL, MAXNAMELEN, NULL, NULL);
zcp = vp->v_data;
zcp->zc_id = objset;
+ VOP_UNLOCK(vp, 0, curthread);
return (vp);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url :
http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20090218/41554ee0/attachment.pgp