NetBSD Problem Report #47020

From Manuel.Bouyer@lip6.fr  Sun Sep 30 10:38:08 2012
Return-Path: <Manuel.Bouyer@lip6.fr>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id 0219363E4F1
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 30 Sep 2012 10:38:07 +0000 (UTC)
Message-Id: <20120930103758.CF98F24382@disco.soc.lip6.fr>
Date: Sun, 30 Sep 2012 12:37:58 +0200 (MEST)
From: Manuel.Bouyer@lip6.fr
Reply-To: Manuel.Bouyer@lip6.fr
To: gnats-bugs@gnats.NetBSD.org
Subject: fss(4) panic
X-Send-Pr-Version: 3.95

>Number:         47020
>Category:       kern
>Synopsis:       fss(4) panic
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    hannken
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Sep 30 10:40:00 +0000 2012
>Closed-Date:    Tue Feb 12 09:18:24 +0000 2013
>Last-Modified:  Tue Feb 12 09:18:24 +0000 2013
>Originator:     Manuel Bouyer
>Release:        NetBSD 6.0_RC2
>Organization:
>Environment:
System: NetBSD disco.soc.lip6.fr 6.0_RC2 NetBSD 6.0_RC2 (DISCO) #57: Wed Sep 26 23:25:27 CEST 2012 bouyer@houla:/dsk/l1/misc/bouyer/tmp/amd64/obj/dsk/l1/misc/bouyer/netbsd-6/src/sys/arch/amd64/compile/DISCO amd64
Architecture: x86_64
Machine: amd64
>Description:
	On a server with some large disks:
/dev/sd0a          188M       149M        30M  83% /
/dev/sd0g          1.9G        56M       1.8G   2% /var
/dev/sd0e          4.8G       1.0G       3.5G  22% /usr
/dev/sd0f           12G       9.5G       2.1G  81% /home
/dev/dk0           5.0T       478G       4.3T   9% /users/disco5
/dev/dk1           5.9T       585G       5.0T  10% /users/disco6
/dev/dk2           1.4T       126G       1.2T   9% /users/disco1
/dev/dk3           1.4T       229G       1.1T  16% /users/disco3
/dev/dk4           445G        48G       375G  11% /users/disco4
	 I enabled fsck in the daily run with snapshots: in /etc/daily.conf
run_fsck=YES run_fsck_flags="-Tffs:-x/users/disco5/"

	(this means that all filesystems are checked on an external
	 snapshot, exept /users/disco5).
	The following night it paniced with (restored from the mess printed
on console created by all the "WARNING SPL NOT LOWERED ON SYSCALL EXIT"
messages mixed with the real panic message - I may have missed something,
or mixed numbers):
panic: kernel diagnostic assertion  "vp ==  vp->v_specnode->sn_dev->sd_bdevvp"  failed: file /dsk/l1/misc/bouyer/netbsd-6/src/sys/miscfs/specfs/spec_vnops.c", line 757    
cpu23:  begin traceback...        
kern_assert at netbsd:: kern_assert+0x48      
spec_ioctl at netbsd :spec_ioctl+0x101    
VOP_IOCTL at netbsd:VOP_IOCTL+0x33b                                        
getdisksize at netbsd: :get disksize+0x47  
fss_ioctl at  netbsd:fss_ioctl+0x50f 
vn_ioctl at netbsd:vn_ioctl+0x76     
sys_ioctl() at netbsd:sys_ioctl+0xc7

There was probably some NFS activity running at the same time,
as well as some amanda dumps (running without snapshots).

>How-To-Repeat:
	I did run the fsck -x by hand several times before enabling it in
	rc.conf, and didn't see this problem. So I guess other factors are
	needed, maybe the dump running, or some other FS activity
>Fix:

>Release-Note:

>Audit-Trail:
From: "J. Hannken-Illjes" <hannken@eis.cs.tu-bs.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/47020: fss(4) panic
Date: Sun, 30 Sep 2012 18:03:35 +0200

 Manuel,

 do you have a core dump?  I'm interested in the file system fss is working
 on and both vnodes (vp and sd_bdevvp).

 --
 Juergen Hannken-Illjes - hannken@eis.cs.tu-bs.de - TU Braunschweig (Germany)

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@NetBSD.org, gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org
Subject: Re: kern/47020: fss(4) panic
Date: Sun, 30 Sep 2012 18:20:46 +0200

 On Sun, Sep 30, 2012 at 04:05:03PM +0000, J. Hannken-Illjes wrote:
 > The following reply was made to PR kern/47020; it has been noted by GNATS.
 > 
 > From: "J. Hannken-Illjes" <hannken@eis.cs.tu-bs.de>
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: kern/47020: fss(4) panic
 > Date: Sun, 30 Sep 2012 18:03:35 +0200
 > 
 >  Manuel,
 >  
 >  do you have a core dump? 

 unfortunably not, the swap partition is not large enough

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --

From: "J. Hannken-Illjes" <hannken@eis.cs.tu-bs.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/47020: fss(4) panic
Date: Sun, 20 Jan 2013 10:11:52 +0100

 --Apple-Mail=_2713A985-26FE-4C89-BCCB-EC1063C2ED44
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=us-ascii

 This assertion fires when creating an external snapshot of
 the root file system.

 Manuel, please try the attached patch.

 --
 J. Hannken-Illjes - hannken@eis.cs.tu-bs.de - TU Braunschweig (Germany)


 --Apple-Mail=_2713A985-26FE-4C89-BCCB-EC1063C2ED44
 Content-Disposition: attachment;
 	filename=fss.c.diff
 Content-Type: application/octet-stream;
 	name="fss.c.diff"
 Content-Transfer-Encoding: 7bit

 Index: fss.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/fss.c,v
 retrieving revision 1.83
 diff -p -u -2 -r1.83 fss.c
 --- fss.c	28 Jul 2012 16:14:17 -0000	1.83
 +++ fss.c	20 Jan 2013 09:07:40 -0000
 @@ -622,5 +622,5 @@ fss_create_files(struct fss_softc *sc, s
      off_t *bsize, struct lwp *l)
  {
 -	int error, bits, fsbsize;
 +	int i, error, bits, fsbsize;
  	uint64_t numsec;
  	unsigned int secsize;
 @@ -693,23 +693,29 @@ fss_create_files(struct fss_softc *sc, s

  	/*
 -	 * Get the block device it is mounted on.
 +	 * Get the block device it is mounted on and its size.
  	 */

 -	error = namei_simple_kernel(sc->sc_mount->mnt_stat.f_mntfromname,
 -				NSM_FOLLOW_NOEMULROOT, &vp);
 -	if (error != 0)
 -		return error;
 -
 -	if (vp->v_type != VBLK) {
 -		vrele(vp);
 +	mutex_enter(&device_lock);
 +	for (i = 0; i < SPECHSZ; i++) {
 +		for (vp = specfs_hash[i]; vp; vp = vp->v_specnext) {
 +			if (vp->v_type == VBLK &&
 +			    vp == vp->v_specnode->sn_dev->sd_bdevvp &&
 +			    vp->v_specmountpoint == sc->sc_mount)
 +				break;
 +		}
 +		if (vp != NULL)
 +			break;
 +	}
 +	if (vp == NULL) {
 +		mutex_exit(&device_lock);
  		return EINVAL;
  	}
 -
 +	mutex_enter(vp->v_interlock);
 +	mutex_exit(&device_lock);
 +	error = vget(vp, 0);
 +	if (error)
 +		return error;
  	sc->sc_bdev = vp->v_rdev;

 -	/*
 -	 * Get the block device size.
 -	 */
 -
  	error = getdisksize(vp, &numsec, &secsize);
  	vrele(vp);

 --Apple-Mail=_2713A985-26FE-4C89-BCCB-EC1063C2ED44--

From: "Juergen Hannken-Illjes" <hannken@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/47020 CVS commit: src/sys/dev
Date: Wed, 6 Feb 2013 09:33:17 +0000

 Module Name:	src
 Committed By:	hannken
 Date:		Wed Feb  6 09:33:17 UTC 2013

 Modified Files:
 	src/sys/dev: fss.c

 Log Message:
 Lookup the block device mounted on from the specfs_hash table.
 This doesn't belong here but makes it possible to pullup.

 Fixes PR kern/47020 (fss(4) panic)


 To generate a diff of this commit:
 cvs rdiff -u -r1.84 -r1.85 src/sys/dev/fss.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

Responsible-Changed-From-To: kern-bug-people->hannken
Responsible-Changed-By: hannken@NetBSD.org
Responsible-Changed-When: Fri, 08 Feb 2013 10:02:51 +0000
Responsible-Changed-Why:
Take.


State-Changed-From-To: open->pending-pullups
State-Changed-By: hannken@NetBSD.org
State-Changed-When: Fri, 08 Feb 2013 10:02:51 +0000
State-Changed-Why:
Fixed in tree -- pullup requested.


From: "Jeff Rizzo" <riz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/47020 CVS commit: [netbsd-6-0] src/sys/dev
Date: Mon, 11 Feb 2013 20:39:05 +0000

 Module Name:	src
 Committed By:	riz
 Date:		Mon Feb 11 20:39:05 UTC 2013

 Modified Files:
 	src/sys/dev [netbsd-6-0]: fss.c

 Log Message:
 Pull up following revision(s) (requested by hannken in ticket #810):
 	sys/dev/fss.c: revision 1.85
 Lookup the block device mounted on from the specfs_hash table.
 This doesn't belong here but makes it possible to pullup.
 Fixes PR kern/47020 (fss(4) panic)


 To generate a diff of this commit:
 cvs rdiff -u -r1.81.4.1.4.1 -r1.81.4.1.4.2 src/sys/dev/fss.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Jeff Rizzo" <riz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/47020 CVS commit: [netbsd-6] src/sys/dev
Date: Mon, 11 Feb 2013 20:39:29 +0000

 Module Name:	src
 Committed By:	riz
 Date:		Mon Feb 11 20:39:28 UTC 2013

 Modified Files:
 	src/sys/dev [netbsd-6]: fss.c

 Log Message:
 Pull up following revision(s) (requested by hannken in ticket #810):
 	sys/dev/fss.c: revision 1.85
 Lookup the block device mounted on from the specfs_hash table.
 This doesn't belong here but makes it possible to pullup.
 Fixes PR kern/47020 (fss(4) panic)


 To generate a diff of this commit:
 cvs rdiff -u -r1.81.4.2 -r1.81.4.3 src/sys/dev/fss.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: hannken@NetBSD.org
State-Changed-When: Tue, 12 Feb 2013 09:18:24 +0000
State-Changed-Why:
Pulled up.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.