i386/66261: fsck cannot recover filesystem corruption

Levent Serinol lserinol at yahoo.com
Tue May 4 09:20:23 PDT 2004


>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 at 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<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  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: <math processor> on motherboard
npx0: INT 16 interface
pcib0: <Host to PCI bridge> on motherboard
pci0: <PCI bus> on pcib0
pci0: <unknown card> (vendor=0x8086, dev=0x2541) at 0.1
pcib1: <PCI to PCI bridge (vendor=8086 device=2545)> at device 3.0 on pci0
pci2: <PCI bus> on pcib1
pci2: <unknown card> (vendor=0x8086, dev=0x1461) at 28.0
pcib2: <PCI to PCI bridge (vendor=8086 device=1460)> at device 29.0 on pci2
pci4: <PCI bus> on pcib2
em0: <Intel(R) PRO/1000 Network Connection, Version - 1.7.16> port 0x2040-0x207f mem 0xfea60000-0xfea7ffff irq 9 at device 5.0 on pci4
em0:  Speed:N/A  Duplex:N/A
em1: <Intel(R) PRO/1000 Network Connection, Version - 1.7.16> port 0x2000-0x203f mem 0xfea80000-0xfea9ffff irq 9 at device 5.1 on pci4
em1:  Speed:N/A  Duplex:N/A
pci2: <unknown card> (vendor=0x8086, dev=0x1461) at 30.0
pcib3: <PCI to PCI bridge (vendor=8086 device=1460)> at device 31.0 on pci2
pci3: <PCI bus> on pcib3
aac0: <Adaptec SCSI RAID 2200S> 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<CLUSTERS,WCACHE,DATA64,HOSTTIME,RAID50,WINDOW4GB,SOFTERR,NORECOND,SGMAP64,ALARM,NONDASD>
pci0: <unknown card> (vendor=0x8086, dev=0x2546) at 3.1
pcib4: <Intel 82801BA/BAM (ICH2) Hub to PCI bridge> at device 30.0 on pci0
pci1: <PCI bus> on pcib4
pci1: <ATI Mach64-GR graphics accelerator> at 12.0 irq 11
isab0: <PCI to ISA bridge (vendor=8086 device=2480)> at device 31.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel ICH3 ATA100 controller> 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: <unknown card> (vendor=0x8086, dev=0x2483) at 31.3 irq 0
orm0: <Option ROMs> at iomem 0xc0000-0xc7fff,0xc8000-0xcbfff,0xcc000-0xcd7ff,0xcd800-0xcefff,0xe4000-0xe7fff on isa0
pmtimer0 on isa0
fdc0: <NEC 72065B or clone> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
fdc0: FIFO enabled, 8 bytes threshold
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
atkbd0: <AT Keyboard> flags 0x1 irq 1 on atkbdc0
kbd0 at atkbd0
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: model IntelliMouse Explorer, device ID 4
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
sio0: configured irq 4 not in bitmap of probed irqs 0
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 8250
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
ppc0: parallel port not found.
acd0: CDROM <SAMSUNG CD-ROM SC-152G> at ata0-slave PIO4
aacd0: <RAID 0/1> on aac0
aacd0: 279996MB (573433088 sectors)
aacd1: <RAID 0/1> on aac0
aacd1: 419994MB (860149632 sectors)
Mounting root from ufs:/dev/aacd0s1a
em0: Link is up 100 Mbps Full Duplex
em0: Link is up 100 Mbps Full Duplex

>How-To-Repeat:
It occured two times on different machines on same freebsd version with big partition sizes after power outage. 
>Fix:
none
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-i386 mailing list