From nobody@FreeBSD.org  Mon Nov  7 14:28:00 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id CB7EC16A41F
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  7 Nov 2005 14:28:00 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 8518E43D45
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  7 Nov 2005 14:28:00 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id jA7ES0l2029051
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 7 Nov 2005 14:28:00 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id jA7ES0Es029050;
	Mon, 7 Nov 2005 14:28:00 GMT
	(envelope-from nobody)
Message-Id: <200511071428.jA7ES0Es029050@www.freebsd.org>
Date: Mon, 7 Nov 2005 14:28:00 GMT
From: Pawel Rutkowski <pawel.rsc[despammer]pl@FreeBSD.org (at) (dot)>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Geli cause kernel panic under heavy disk usage
X-Send-Pr-Version: www-2.3

>Number:         88601
>Category:       kern
>Synopsis:       [geli] geli cause kernel panic under heavy disk usage
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-geom
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 07 14:30:16 GMT 2005
>Closed-Date:    Tue Apr 19 12:43:26 UTC 2011
>Last-Modified:  Tue Apr 19 12:43:26 UTC 2011
>Originator:     Pawel Rutkowski
>Release:        6.0-STABLE
>Organization:
>Environment:
FreeBSD backup.int.rsc.pl 6.0-STABLE FreeBSD 6.0-STABLE #2: Sat Nov  5 15:54:32 CET 2005     root@ruthibm.int.rsc.pl:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
While coping few big files (8x700MB) and 25GB of smaller files on GELI encrypted volume i got PANIC:

mode = 0121473, inum = 185008, FS = /mnt
Panic: ffs_valloc: dup alloc
UPTIME: 1h41m44s

Doing same operation on gbde volume or unencrypted file system works OK.

Backtrace:
mode = 0121473, inum = 185008, fs = /mnt
panic: ffs_valloc: dup alloc
Uptime: 1h41m44s
Dumping 62 MB (3 chunks)
  chunk 0: 1MB (160 pages) ... ok
  chunk 1: 14MB (3584 pages) ... ok
  chunk 2: 48MB (12285 pages) 33 17

#0  doadump () at pcpu.h:165
165     pcpu.h: No such file or directory.
        in pcpu.h
#0  doadump () at pcpu.h:165
#1  0xc0638846 in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:399
#2  0xc0638adc in panic (fmt=0xc0878f8c "ffs_valloc: dup alloc")
    at /usr/src/sys/kern/kern_shutdown.c:555
#3  0xc076dd20 in ffs_valloc (pvp=0xc1757330, mode=33060, cred=0xc15f0980,
    vpp=0xca1de8d4) at /usr/src/sys/ufs/ffs/ffs_alloc.c:933
#4  0xc0794177 in ufs_makeinode (mode=33060, dvp=0xc1757330, vpp=0xca1debe0,
    cnp=0xca1debf4) at /usr/src/sys/ufs/ufs/ufs_vnops.c:2165
#5  0xc0791381 in ufs_create (ap=0x0) at /usr/src/sys/ufs/ufs/ufs_vnops.c:171
#6  0xc0817a50 in VOP_CREATE_APV (vop=0x0, a=0xca1dea64) at vnode_if.c:204
#7  0xc06995e0 in vn_open_cred (ndp=0xca1debcc, flagp=0xca1deccc, cmode=292,
    cred=0xc15f0980, fdidx=3) at vnode_if.h:111
#8  0xc069941e in vn_open (ndp=0x0, flagp=0xca1deccc, cmode=292, fdidx=3)
    at /usr/src/sys/kern/vfs_vnops.c:91
#9  0xc069246e in kern_open (td=0xc1367900, path=0x0, pathseg=UIO_USERSPACE,
    flags=1538, mode=292) at /usr/src/sys/kern/vfs_syscalls.c:979
#10 0xc0692382 in open (td=0xc1367900, uap=0xca1ded04)
    at /usr/src/sys/kern/vfs_syscalls.c:945
#11 0xc0808bd7 in syscall (frame=
      {tf_fs = -1078001605, tf_es = -1078001605, tf_ds = -1078001605, tf_edi = 134579329, tf_esi = 134579200, tf_ebp = -1077941656, tf_isp = -904008348, tf_ebx = 671701828, tf_edx = 134578176, tf_ecx = 134680576, tf_eax = 5, tf_trapno = 0, tf_err = 2, tf_eip = 672114675, tf_cs = 51, tf_eflags = 582, tf_esp = -107794176
4, tf_ss = 59}) at /usr/src/sys/i386/i386/trap.c:976
#12 0xc07f7aaf in Xint0x80_syscall () at /usr/src/sys/i386/i386/exception.s:200
#13 0x00000033 in ?? ()



System information:
Copyright (c) 1992-2005 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD 6.0-STABLE #2: Sat Nov  5 15:54:32 CET 2005
    root@ruthibm.int.rsc.pl:/usr/obj/usr/src/sys/GENERIC
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Pentium II/Pentium II Xeon/Celeron (334.09-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x660  Stepping = 0
  Features=0x183f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR>
real memory  = 67096576 (63 MB)
avail memory = 55066624 (52 MB)
ACPI disabled by blacklist.  Contact your BIOS vendor.
npx0: [FAST]
npx0: <math processor> on motherboard
npx0: INT 16 interface
cpu0 on motherboard
pcib0: <Intel 82443BX (440 BX) host to PCI bridge> pcibus 0 on motherboard
pir0: <PCI Interrupt Routing Table: 6 Entries> on motherboard
pci0: <PCI bus> on pcib0
agp0: <Intel 82443BX (440 BX) host to PCI bridge> mem 0xe4000000-0xe7ffffff at device 0.0 on pci0
pcib1: <PCI-PCI bridge> at device 1.0 on pci0
pci1: <PCI bus> on pcib1
pci1: <display, VGA> at device 0.0 (no driver attached)
isab0: <PCI-ISA bridge> at device 4.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel PIIX4 UDMA33 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xd800-0xd80f at device 4.1 on pci0
ata0: <ATA channel 0> on atapci0
ata1: <ATA channel 1> on atapci0
uhci0: <Intel 82371AB/EB (PIIX4) USB controller> port 0xd400-0xd41f irq 10 at device 4.2 on pci0
uhci0: [GIANT-LOCKED]
usb0: <Intel 82371AB/EB (PIIX4) USB controller> on uhci0
usb0: USB revision 1.0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
pci0: <bridge> at device 4.3 (no driver attached)
fxp0: <Intel 82559 Pro/100 Ethernet> port 0xd000-0xd03f mem 0xdb800000-0xdb800fff,0xdb000000-0xdb0fffff irq 11 at device 11.0 on pci0
miibus0: <MII bus> on fxp0
inphy0: <i82555 10/100 media interface> on miibus0
inphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
fxp0: Ethernet address: 00:d0:b7:2b:93:25
pmtimer0 on isa0
orm0: <ISA Option ROMs> at iomem 0xc0000-0xc7fff,0xc8000-0xc97ff on isa0
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
fdc0: <Enhanced floppy controller> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
fdc0: [FAST]
ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0
ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/9 bytes threshold
ppbus0: <Parallel port bus> on ppc0
plip0: <PLIP network interface> on ppbus0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
unknown: <PNP0401> can't assign resources (port)
unknown: <PNP0501> can't assign resources (port)
unknown: <PNP0501> can't assign resources (port)
unknown: <PNP0700> can't assign resources (port)
unknown: <PNP0c01> can't assign resources (memory)
unknown: <PNP0303> can't assign resources (port)
unknown: <PNP0c02> can't assign resources (port)
Timecounter "TSC" frequency 334093110 Hz quality 800
Timecounters tick every 1.000 msec
ad0: 6149MB <WDC AC26400R 17.01J17> at ata0-master UDMA33
ad1: 38166MB <WDC WD400AB-00CBA1 04.07B04> at ata0-slave UDMA33
ad3: 38166MB <Seagate ST340823A 3.39> at ata1-slave UDMA33
Trying to mount root from ufs:/dev/ad0s1a

>How-To-Repeat:
# fdisk -BI /dev/ad3s1
# geli init -s 8192 /dev/ad3s1
(used password: 1234567890)
# geli attach /dev/ad3s1
# newfs -U -O2 /dev/ad3s1.eli
# mount -o noatime /dev/ad3s1.eli /mnt

start coping files to encrypted volume. I've been coping about 30GB rdiff-backup (lots of small, gziped files) repository.

In about 2h You should get panic
>Fix:
              
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->pjd 
Responsible-Changed-By: pjd 
Responsible-Changed-When: Mon Nov 7 15:43:08 GMT 2005 
Responsible-Changed-Why:  
I'll take this one. 

Could you confirm, that the problem doesn't exist with gbde or for 
file system without encryption when sector size of provider is also 
8kB? I want to be sure, this is not a UFS bug. 

You can change provider's sector size using gnop(8): 

# gnop create -S 8192 /dev/da0 
# newfs /dev/da0.nop 

http://www.freebsd.org/cgi/query-pr.cgi?pr=88601 

From: Pawel Rutkowski <pawel@rsc.pl>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/88601: Geli cause kernel panic under heavy disk usage
Date: Tue, 8 Nov 2005 21:53:39 +0100

 It looks ok on unencrypted FS. I've copied two times same data that in
 orginal report without panic.
 
 Steps i've done: 
 # gnop create -S 8192 /dev/ad3s1
 # newfs -O2 -U /dev/ad3s1.nop
 # mount /dev/ad3s1.nop
 # cd /home
 # tar -cf - . | tar -xvf - 
 
 I've also tested geli without changing sector size - it worked without
 any problem also. 
 
 From my observation, it seems to cause problem when i specify sector
 size for geli.
 
 -- 
         Pawel Rutkowski                   Centauri RSC
         +48 22 847 68 52                http://www.rsc.pl

From: Pawel Jakub Dawidek <pjd@FreeBSD.org>
To: Pawel Rutkowski <"pawel.rsc [despammer] pl"@FreeBSD.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/88601: Geli cause kernel panic under heavy disk usage
Date: Fri, 7 Apr 2006 01:41:05 +0200

 --qGV0fN9tzfkG3CxV
 Content-Type: text/plain; charset=iso-8859-2
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 +> >How-To-Repeat:
 +> # fdisk -BI /dev/ad3s1
 +> # geli init -s 8192 /dev/ad3s1
 +> (used password: 1234567890)
 +> # geli attach /dev/ad3s1
 +> # newfs -U -O2 /dev/ad3s1.eli
 +> # mount -o noatime /dev/ad3s1.eli /mnt
 +>=20
 +> start coping files to encrypted volume. I've been coping about 30GB rdif=
 f-backup (lots of small, gziped files) repository.
 +>=20
 +> In about 2h You should get panic
 
 What compilation options do you use when compilling the kernel?
 If not standard ones, can you recompile the whole kernel with standard
 options and see if you can still reproduce it?
 
 I was able to reproduce the problem on one of my test machines where I
 was using -O0. Commenting out CFLAGS+=3D-O0 from make.conf fixed the
 problem.
 
 --=20
 Pawel Jakub Dawidek                       http://www.wheel.pl
 pjd@FreeBSD.org                           http://www.FreeBSD.org
 FreeBSD committer                         Am I Evil? Yes, I Am!
 
 --qGV0fN9tzfkG3CxV
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.2 (FreeBSD)
 
 iD8DBQFENacRForvXbEpPzQRApP1AJ9ISKaALcYMSyLs00NJdhImupGJdACfUh0Z
 bajQDQO43MdY54xby70iC98=
 =OLLU
 -----END PGP SIGNATURE-----
 
 --qGV0fN9tzfkG3CxV--
Responsible-Changed-From-To: pjd->freebsd-geom 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu May 28 22:14:45 UTC 2009 
Responsible-Changed-Why:  
pjd is not actively working on GEOM at the moment. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=88601 
State-Changed-From-To: open->feedback 
State-Changed-By: jh 
State-Changed-When: Fri Mar 11 11:52:31 UTC 2011 
State-Changed-Why:  
Is this still a problem for you? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=88601 
State-Changed-From-To: feedback->closed 
State-Changed-By: ae 
State-Changed-When: Tue Apr 19 12:42:56 UTC 2011 
State-Changed-Why:  
Feedback timeout. 

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