From owner-freebsd-i386@FreeBSD.ORG Tue May 4 09:20:23 2004 Return-Path: Delivered-To: freebsd-i386@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 78BAB16A4CE for ; Tue, 4 May 2004 09:20:23 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 07C4D43D48 for ; Tue, 4 May 2004 09:20:23 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i44GKMnd069084 for ; Tue, 4 May 2004 09:20:22 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i44GKMeU069083; Tue, 4 May 2004 09:20:22 -0700 (PDT) (envelope-from gnats) Resent-Date: Tue, 4 May 2004 09:20:22 -0700 (PDT) Resent-Message-Id: <200405041620.i44GKMeU069083@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-i386@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Levent Serinol Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7BA3216A4CE for ; Tue, 4 May 2004 09:19:57 -0700 (PDT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A30F43D1F for ; Tue, 4 May 2004 09:19:57 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i44GJuM4040398 for ; Tue, 4 May 2004 09:19:56 -0700 (PDT) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.11/8.12.11/Submit) id i44GJuEh040397; Tue, 4 May 2004 09:19:56 -0700 (PDT) (envelope-from nobody) Message-Id: <200405041619.i44GJuEh040397@www.freebsd.org> Date: Tue, 4 May 2004 09:19:56 -0700 (PDT) From: Levent Serinol To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: i386/66261: fsck cannot recover filesystem corruption X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 May 2004 16:20:23 -0000 >Number: 66261 >Category: i386 >Synopsis: fsck cannot recover filesystem corruption >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-i386 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue May 04 09:20:22 PDT 2004 >Closed-Date: >Last-Modified: >Originator: Levent Serinol >Release: FreeBSD 4.9-RELEASE (GENERIC) #0 >Organization: N/A >Environment: FreeBSD 4.9-RELEASE (GENERIC) #0: Mon Oct 27 17:51:09 GMT 2003 >Description: This machines works as an nfs server. We had a power outage this morning. There was no load on the server at the time.We faced with this problem before on a different machine which also running as nfs server. when I looked the fsck code it looks that fsck couldn't allocate mem for a new directory entry (inode) structure on first phase. the error occurs while system fscking the partition. message is as follows: cannot increase directory list and the fsck stops after this message, so we cannot fix our corrupted filesystem. Looking for the fsck code in function cacheino how can this be happened ? it's simply malloc operation and there is no sign of out of memory situation on the machine. if (howmany(DIP(dp, di_size), sblock.fs_bsize) > NDADDR) blks = NDADDR + NIADDR; else blks = howmany(DIP(dp, di_size), sblock.fs_bsize); inp = (struct inoinfo *) malloc(sizeof(*inp) + (blks - 1) * sizeof(ufs2_daddr_t)); if (inp == NULL) errx(EEXIT, "cannot increase directory list"); inpp = &inphead[inumber % dirhash]; inp->i_nexthash = *inpp; *inpp = inp; inp->i_parent = inumber == ROOTINO ? ROOTINO : (ino_t)0; inp->i_dotdot = (ino_t)0; inp->i_number = inumber; inp->i_isize = DIP(dp, di_size); inp->i_numblks = blks; for (i = 0; i < (blks < NDADDR ? blks : NDADDR); i++) inp->i_blks[i] = DIP(dp, di_db[i]); if (blks > NDADDR) for (i = 0; i < NIADDR; i++) inp->i_blks[NDADDR + i] = DIP(dp, di_ib[i]); if (inplast == listmax) { listmax += 100; inpsort = (struct inoinfo **)realloc((char *)inpsort, (unsigned)listmax * sizeof(struct inoinfo *)); if (inpsort == NULL) errx(EEXIT, "cannot increase directory list"); } inpsort[inplast++] = inp; Copyright (c) 1992-2003 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 4.9-RELEASE #0: Mon Oct 27 17:51:09 GMT 2003 root@freebsd-stable.sentex.ca:/usr/obj/usr/src/sys/GENERIC Timecounter "i8254" frequency 1193182 Hz CPU: Intel(R) Xeon(TM) CPU 2.40GHz (2392.29-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0xf27 Stepping = 7 Features=0xbfebfbff Hyperthreading: 2 logical CPUs real memory = 1073676288 (1048512K bytes) avail memory = 1039495168 (1015132K bytes) Preloaded elf kernel "kernel" at 0xc053f000. Warning: Pentium 4 CPU: PSE disabled Pentium Pro MTRR support enabled md0: Malloc disk Using $PIR table, 18 entries at 0xc00f35f0 npx0: on motherboard npx0: INT 16 interface pcib0: on motherboard pci0: on pcib0 pci0: (vendor=0x8086, dev=0x2541) at 0.1 pcib1: at device 3.0 on pci0 pci2: on pcib1 pci2: (vendor=0x8086, dev=0x1461) at 28.0 pcib2: at device 29.0 on pci2 pci4: on pcib2 em0: port 0x2040-0x207f mem 0xfea60000-0xfea7ffff irq 9 at device 5.0 on pci4 em0: Speed:N/A Duplex:N/A em1: port 0x2000-0x203f mem 0xfea80000-0xfea9ffff irq 9 at device 5.1 on pci4 em1: Speed:N/A Duplex:N/A pci2: (vendor=0x8086, dev=0x1461) at 30.0 pcib3: at device 31.0 on pci2 pci3: on pcib3 aac0: mem 0xf0000000-0xf7ffffff irq 9 at device 1.0 on pci3 aac0: i960RX 100MHz, 112MB cache memory, optional battery present aac0: Kernel 4.0-0, Build 6011, S/N ba0078 aac0: Supported Options=1f7e pci0: (vendor=0x8086, dev=0x2546) at 3.1 pcib4: at device 30.0 on pci0 pci1: on pcib4 pci1: at 12.0 irq 11 isab0: at device 31.0 on pci0 isa0: on isab0 atapci0: port 0x3a0-0x3af,0-0x3,0-0x7,0-0x3,0-0x7 irq 0 at device 31.1 on pci0 ata0: at 0x1f0 irq 14 on atapci0 ata1: at 0x170 irq 15 on atapci0 pci0: (vendor=0x8086, dev=0x2483) at 31.3 irq 0 orm0: