From nobody@FreeBSD.org  Sat Sep 12 16:22:37 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F0F4E106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 12 Sep 2009 16:22:37 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id E007A8FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 12 Sep 2009 16:22:37 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n8CGMb3H085964
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 12 Sep 2009 16:22:37 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n8CGMb7j085963;
	Sat, 12 Sep 2009 16:22:37 GMT
	(envelope-from nobody)
Message-Id: <200909121622.n8CGMb7j085963@www.freebsd.org>
Date: Sat, 12 Sep 2009 16:22:37 GMT
From: Tim Bishop <tim@bishnet.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ZFS panic: "panic: dirtying snapshot!"
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         138764
>Category:       kern
>Synopsis:       [zfs] [panic] ZFS panic: "panic: dirtying snapshot!"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pjd
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Sep 12 16:30:07 UTC 2009
>Closed-Date:    Sat Nov 14 14:30:54 UTC 2009
>Last-Modified:  Sat Nov 14 14:30:54 UTC 2009
>Originator:     Tim Bishop
>Release:        8-STABLE (post BETA4)
>Organization:
>Environment:
FreeBSD aberfal.kent.ac.uk 8.0-BETA4 FreeBSD 8.0-BETA4 #23: Fri Sep 11 18:33:19 BST 2009     tdb@aberfal.kent.ac.uk:/usr/obj/usr/src/sys/ABERFAL  i386
>Description:
I'm running with a ZFS root file system using GPT partitioning and gptzfsboot. I then started using ZFS snapshots by using the sysutils/freebsd-snapshot port. This port basically just runs "zfs snapshot" and does some housekeeping.

The first snapshot went fine (when the machine was quiet). The second (when the machine was doing a portupgrade) caused a panic. All I have on the console is:

panic: dirtying snapshot

I traced this down to:

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c:1104

void
dsl_dataset_dirty(dsl_dataset_t *ds, dmu_tx_t *tx)
{
        dsl_pool_t *dp;

        if (ds == NULL) /* this is the meta-objset */
                return;

        ASSERT(ds->ds_user_ptr != NULL);

        if (ds->ds_phys->ds_next_snap_obj != 0)
                panic("dirtying snapshot!");

        dp = ds->ds_dir->dd_pool;

        if (txg_list_add(&dp->dp_dirty_datasets, ds, tx->tx_txg) == 0) {
                /* up the hold count until we can be written out */
                dmu_buf_add_ref(ds->ds_dbuf, ds);
        }
}

I'm not sure what this means though.

Sadly I have no debugging enabled and no crash dump.
>How-To-Repeat:
Hard to say. Run ZFS root and do snapshots when the machine is busy? I've only seen it once.
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-fs 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Sat Sep 12 18:06:58 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer(s) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138764 
State-Changed-From-To: open->suspended 
State-Changed-By: pjd 
State-Changed-When: pon 14 wrz 2009 12:46:18 UTC 
State-Changed-Why:  
At least backtrace is needed to start working on this problem. 
Suspend PR until backtrace is provided. 


Responsible-Changed-From-To: freebsd-fs->pjd 
Responsible-Changed-By: pjd 
Responsible-Changed-When: pon 14 wrz 2009 12:46:18 UTC 
Responsible-Changed-Why:  
I'll take this one. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138764 
State-Changed-From-To: suspended->feedback 
State-Changed-By: pjd 
State-Changed-When: ptk 30 pa 2009 23:35:53 UTC 
State-Changed-Why:  
Could you verify if r198703 fixes your problem? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138764 
State-Changed-From-To: feedback->closed 
State-Changed-By: pjd 
State-Changed-When: sob 14 lis 2009 14:29:32 UTC 
State-Changed-Why:  
r198703 should fix the problem. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138764 
>Unformatted:
