Re: zfs: Fatal trap 12: page fault while in kernel mode

From: Pawel Jakub Dawidek <pjd_at_FreeBSD.org>
Date: Wed, 29 Jul 2009 23:18:03 +0200
On Wed, Jul 29, 2009 at 10:15:06PM +0200, Thomas Backman wrote:
> On Jul 29, 2009, at 19:18, Andriy Gapon wrote:
> 
> >
> >Thanks a lot again!
> >
> >Could you please try the following change?
> >In sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c, in  
> >function
> >zfs_inactive() insert the following line:
> >	vrecycle(vp, curthread);
> >before the following line:
> >	zfs_znode_free(zp);
> >
> >This is in "if (zp->z_dbuf == NULL)" branch.
> >
> >I hope that this should work in concert with the patch that Pawel  
> >has posted.
> >
> >P.S.
> >Also Pawel has told me that adding 'CFLAGS+=-DDEBUG=1' to sys/ 
> >modules/zfs/Makefile
> >should enable additional debugging checks (ASSERTs) in ZFS code.
> >
> >-- 
> >Andriy Gapon
> Better backtraces:
> 
> Without your vrecycle() addition, and with the -DDEBUG=1 one (note to  
> self: core.txt.32):
> 
> Unread portion of the kernel message buffer:
> panic: solaris assert: ((zp)->z_vnode) == ((void *)0), file: /usr/src/ 
> sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/ 
> zfs_znode.c, line: 1043

Modify zfs_inactive() 'zp->z_dbuf == NULL' case to look like this:

	if (zp->z_dbuf == NULL) {
		/*
		 * The fs has been unmounted, or we did a
		 * suspend/resume and this file no longer exists.
		 */
		VI_LOCK(vp);
		vp->v_count = 0; /* count arrives as 1 */
		vp->v_data = NULL;
		VI_UNLOCK(vp);
		rw_exit(&zfsvfs->z_teardown_inactive_lock);
		ZTOV(zp) = NULL;
		vrecycle(vp, curthread);
		zfs_znode_free(zp);
		return;
	}

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd_at_FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!

Received on Wed Jul 29 2009 - 19:17:47 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:52 UTC