NetBSD Problem Report #25240

Received: (qmail 2726 invoked by uid 605); 19 Apr 2004 12:36:30 -0000
Message-Id: <20040419123624.D5BF31F@sedez.iq.pl>
Date: Mon, 19 Apr 2004 14:36:24 +0200 (CEST)
From: Piotr Stolc <socrtp@soclab.eu.org>
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: Piotr Stolc <socrtp@soclab.eu.org>
To: gnats-bugs@gnats.NetBSD.org
Subject: cgd+vnd+NFS panic
X-Send-Pr-Version: 3.95

>Number:         25240
>Category:       kern
>Synopsis:       cgd+vnd+NFS panic
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    elric
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 19 12:37:00 +0000 2004
>Closed-Date:    Mon Apr 19 16:09:01 +0000 2004
>Last-Modified:  Sun May 25 19:25:01 +0000 2014
>Originator:     Piotr Stolc
>Release:        NetBSD 2.0_BETA
>Organization:
soclab
>Environment:


System: NetBSD s 2.0_BETA NetBSD 2.0_BETA (S) #4: Mon Apr 19 11:10:22 CEST 2004 pkgadm@s:/home/pkgadm/sys/arch/i386/compile/S i386
Architecture: i386
Machine: i386
>Description:

	Configuring cgd on vnode attached to file on NFS crashes the
kernel. Everything works ok with vnode on local drive. On 1.6ZK kernel
this NFS combination works OK.

root@s:/var/crash# gdb /netbsd
GNU gdb 5.3nb1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386--netbsdelf"...(no debugging symbols
found)...
(gdb) target kcore netbsd.2.core
panic: biodone already
#0  0x00000001 in ?? ()
(gdb) bt
#0  0x00000001 in ?? ()
#1  0xc026400b in cpu_reboot ()
#2  0xc01c27cc in db_sync_cmd ()
#3  0xc01c221f in db_command ()
#4  0xc01c1f3a in db_command_loop ()
#5  0xc01c4ff8 in db_trap ()
#6  0xc02618ba in kdb_trap ()
#7  0xc026b44c in trap ()
#8  0xc0102c73 in calltrap ()
#9  0xc020090d in panic ()
#10 0xc021c8b7 in biodone ()
#11 0xc01d16d7 in vndstrategy ()
#12 0xc022f559 in spec_strategy ()
#13 0xc022a1cc in VOP_STRATEGY ()
#14 0xc01cae67 in cgdstart ()
#15 0xc01cc463 in dk_start ()
#16 0xc01cafb2 in cgdiodone ()
#17 0xc021c884 in biodone ()
#18 0xc01d16d7 in vndstrategy ()
#19 0xc022f559 in spec_strategy ()
#20 0xc022a1cc in VOP_STRATEGY ()
#21 0xc01cae67 in cgdstart ()
#22 0xc01cc463 in dk_start ()
#23 0xc01cc3d6 in dk_strategy ()
#24 0xc01cac9e in cgdstrategy ()
#25 0xc0262448 in read_sector ()
#26 0xc0262492 in scan_mbr ()
#27 0xc0262644 in readdisklabel ()
#28 0xc01cca92 in dk_getdisklabel ()
#29 0xc01cb431 in cgd_ioctl_set ()
#30 0xc01cb18e in cgdioctl ()
#31 0xc022f2f2 in spec_ioctl ()
#32 0xc0229d2c in VOP_IOCTL ()
#33 0xc0229516 in vn_ioctl ()
#34 0xc02047f2 in sys_ioctl ()
#35 0xc026ae42 in syscall_plain ()
(gdb)


>How-To-Repeat:

# mount soclab:/home/exports/disk1 /disk1
# ls -l /disk1
-rw-r--r--  1 root  wheel  2147483648 Apr 16 01:25 /disk1
# vnconfig vnd0 /disk1
[ this may be also a file on NFS directory, here I mount only a file
like /swap on diskless machines ]
# cgdconfig -V none cgd0 /dev/vnd0d /etc/cgd/vnd0d
/dev/vnd0d's passphrase:

and after entering the password kernel panics.

>Fix:

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: kern-bug-people->elric 
Responsible-Changed-By: elric 
Responsible-Changed-When: Mon Apr 19 10:50:54 EDT 2004 
Responsible-Changed-Why:  
This looks like it should become mine. 

From: Juergen Hannken-Illjes <hannken@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/25240 CVS commit: src/sys/dev
Date: Mon, 19 Apr 2004 16:04:07 +0000 (UTC)

 Module Name:	src
 Committed By:	hannken
 Date:		Mon Apr 19 16:04:07 UTC 2004

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

 Log Message:
 Redo dk_start(). If di->di_diskstart() runs synchronous its biodone() will
 call dk_start() via dk_iodone() before the buffer gets removed from queue.

 Approved by: Roland Dowdeswell <elric@netbsd.org>

 Fixes PR #25240


 To generate a diff of this commit:
 cvs rdiff -r1.11 -r1.12 src/sys/dev/dksubr.c

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

State-Changed-From-To: open->closed 
State-Changed-By: hannken 
State-Changed-When: Mon Apr 19 16:07:08 UTC 2004 
State-Changed-Why:  
Fixed with rev. 1.12 of src/sys/dev/dksubr.c 

From: James Chacon <jmc@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/25240 CVS commit: [netbsd-2-0] src/sys/dev
Date: Wed, 21 Apr 2004 03:18:41 +0000 (UTC)

 Module Name:	src
 Committed By:	jmc
 Date:		Wed Apr 21 03:18:41 UTC 2004

 Modified Files:
 	src/sys/dev [netbsd-2-0]: dksubr.c

 Log Message:
 Pullup rev 1.12 (requested by elric in ticket #163)

 Redo dk_start(). If di->di_diskstart() runs synchronous its biodone() will
 call dk_start() via dk_iodone() before the buffer gets removed from queue.
 PR#25240


 To generate a diff of this commit:
 cvs rdiff -r1.11 -r1.11.2.1 src/sys/dev/dksubr.c

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

From: "Manuel Bouyer" <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/25240 CVS commit: src/sys
Date: Sun, 25 May 2014 19:23:49 +0000

 Module Name:	src
 Committed By:	bouyer
 Date:		Sun May 25 19:23:49 UTC 2014

 Modified Files:
 	src/sys/arch/xen/xen: xbd_xenbus.c
 	src/sys/dev: cgd.c dksubr.c dkvar.h

 Log Message:
 As proposed in
 https://mail-index.netbsd.org/tech-kern/2014/05/21/msg017098.html
 remove dk_start() and dk_iodone() from dksubr.c and move the related code
 to the underlying driver.
 This increase complexity only marginally: the underlying drivers have
 to do the while() loop themselves, but this can now be done properly with
 bufq_peek()/bufq_get(), removing the buffer from the queue at the right time.
 This handle both the recursion and reordering issues (the reordering
 issue is described here:
 https://mail-index.netbsd.org/tech-kern/2014/05/19/msg017089.html
 the recursion isssue is PR #25240).

 Difference with the patch posted to tech-kern@: KASSERT() that the
 buffer we remove with bufq_get() is the same as the one we bufq_peek()'d
 just before.
 Hopefully this will allow more disk drivers to use dksubr.c


 To generate a diff of this commit:
 cvs rdiff -u -r1.62 -r1.63 src/sys/arch/xen/xen/xbd_xenbus.c
 cvs rdiff -u -r1.86 -r1.87 src/sys/dev/cgd.c
 cvs rdiff -u -r1.49 -r1.50 src/sys/dev/dksubr.c
 cvs rdiff -u -r1.18 -r1.19 src/sys/dev/dkvar.h

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

>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.