Date: Tue, 07 Jan 1997 21:10:51 +1100 (EST) From: peter.jeremy@alcatel.com.au To: FreeBSD-gnats-submit@freebsd.org Subject: kern/2393: filesystems not unmounted following shutdown -h Message-ID: <199701071010.VAA03372@vk2pj.alcatel.com.au> Resent-Message-ID: <199701071020.CAA12440@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 2393 >Category: kern >Synopsis: filesystems not unmounted following shutdown -h >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jan 7 02:20:02 PST 1997 >Last-Modified: >Originator: Peter Jeremy >Organization: Peter Jeremy (VK2PJ) peter.jeremy@alcatel.com.au Alcatel Australia Limited 41 Mandible St Phone: +61 2 9690 5019 ALEXANDRIA NSW 2015 Fax: +61 2 9690 5247 >Release: FreeBSD 2.1-STABLE i386 >Environment: Clone VLB i486DX2-50 with no-name VLB IDE controller. FreeBSD 2.1.5-RELEASE #0: Tue Dec 31 06:45:18 EST 1996 root@vk2pj.alcatel.com.au:/home/src/FreeBSD/sys/compile/vk2pj CPU: i486DX (486-class CPU) real memory = 20971520 (20480K bytes) avail memory = 18784256 (18344K bytes) Probing for devices on the ISA bus: sc0 at 0x60-0x6f irq 1 on motherboard sc0: VGA color {16 virtual consoles, flags=0x0} sio0 at 0x3f8-0x3ff irq 4 on isa sio0: type 16450 sio1 at 0x2f8-0x2ff irq 9 on isa sio1: type 16550A sio2 at 0x3e8-0x3ef irq 3 on isa sio2: type 16450 lpt0 at 0x378-0x37f irq 7 on isa lpt0: Interrupt-driven port lp0: TCP/IP capable interface lpt1 at 0x278-0x27f irq 5 on isa lpt1: Interrupt-driven port lp1: TCP/IP capable interface pca0 on motherboard pca0: PC speaker audio driver fdc0 at 0x3f0-0x3f7 irq 6 drq 2 on isa fdc0: NEC 765 fd0: 1.44MB 3.5in wdc0 at 0x1f0-0x1f7 irq 14 on isa wdc0: unit 0 (wd0): {Conner Peripherals 420MB - CFS420A}, 32-bit, multi-block-64 wd0: 406MB (832608 sectors), 826 cyls, 16 heads, 63 S/T, 512 B/S aha0 at 0x334-0x337 irq 11 drq 6 on isa (aha0:6:0): "ARCHIVE VIPER 150 21247 -005" type 1 removable SCSI 1 st0(aha0:6:0): Sequential-Access st0: Archive Viper 150 is a known rogue density code 0x0, drive empty matcd - Matsushita (Panasonic) CD-ROM Driver by FDIV, Version 1(26) 18-Oct-95 matcdc0 at 0x230-0x233 on isa matcdc0 Host interface type 0 matcd0: [CR-5630.75] npx0 on motherboard npx0: INT 16 interface sb0 at 0x220 irq 10 drq 1 on isa sb0: {SoundBlaster 16 4.11} sbxvi0 at 0x0 drq 5 on isa sbxvo0: {SoundBlaster 16 4.11} sbmidi0 at 0x330 on isa {SoundBlaster MPU-401} opl0 at 0x388 on isa opl0: {Yamaha OPL-3 FM} joy0 at 0x201 on isa joy0: joystick >Description: When the system is shut down and halted from multi-user mode, the mounted filesystems are not unmounted cleanly. This causes an fsck on the next reboot. When the system is brought down to single-user, the filesystems manually unmounted and then the system is halted, there is no problem (/ unmounts cleanly). I added some code to /sys/i386/i386/machdep.c:boot() to display dirty buffers (see below) after the `giving up' message. This showed the following quite consistently (there were almost always 4 busy buf's): b_flags == B_ASYNC | B_BUSY | B_CACHE (mostly) | B_WRITEINPROG b_resid == 0 b_bcount == 0x400, 0x800, 0x1800, 0x2000 b_lblkno == b_blkno = 1984, 16, 48, 64 (respectively) b_pblkno varies widely. I haven't seen any pattern b_dev = 0xff00 >How-To-Repeat: [from multi-user mode] # shutdown -h now ... syncing disks ... 4 4 4 4 ... giving up >Fix: [from multi-user mode] # shutdown now [select shell]: sh # umount -av # halt ... syncing disks ... done The added code in machdep.c is: *** /cdrom/usr/src/sys/i386/i386/machdep.c Tue Jun 25 16:19:29 1996 --- /usr/src/sys/i386/i386/machdep.c Sat Nov 30 19:09:47 1996 *************** *** 888,893 **** --- 888,930 ---- * unmount filesystems (thus forcing an fsck on reboot). */ printf("giving up\n"); + for (bp = buf, iter = 0; iter < nbuf; iter++, bp++) { + long flags = bp->b_flags; + if ((flags & (B_BUSY | B_INVAL)) == B_BUSY) { + printf("%4d 0x%08lx", iter, flags); + if (flags & B_AGE) printf(" age"); + if (flags & B_APPENDWRITE) printf(" appendwrite"); + if (flags & B_ASYNC) printf(" async"); + if (flags & B_BAD) printf(" bad"); + if (flags & B_BUSY) printf(" busy"); + if (flags & B_CACHE) printf(" cache"); + if (flags & B_CALL) printf(" call"); + if (flags & B_DELWRI) printf(" delwri"); + if (flags & B_DIRTY) printf(" dirty"); + if (flags & B_DONE) printf(" done"); + if (flags & B_EINTR) printf(" eintr"); + if (flags & B_ERROR) printf(" error"); + if (flags & B_GATHERED) printf(" gathered"); + if (flags & B_INVAL) printf(" inval"); + if (flags & B_LOCKED) printf(" locked"); + if (flags & B_NOCACHE) printf(" nocache"); + if (flags & B_MALLOC) printf(" malloc"); + if (flags & B_CLUSTEROK) printf(" clusterok"); + if (flags & B_PHYS) printf(" phys"); + if (flags & B_RAW) printf(" raw"); + if (flags & B_READ) printf(" read"); + if (flags & B_TAPE) printf(" tape"); + if (flags & B_RELBUF) printf(" relbuf"); + if (flags & B_WANTED) printf(" wanted"); + if (flags & B_WRITEINPROG) printf(" writeinprog"); + if (flags & B_XXX) printf(" xxx"); + if (flags & B_PAGING) printf(" paging"); + if (flags & B_VMIO) printf(" vmio"); + if (flags & B_CLUSTER) printf(" cluster"); + if (flags & B_BOUNCE) printf(" bounce"); + printf(" resid=%x bcount=%x lblk=%d blk=%d pblk=%d dev=%x\n", bp->b_resid, bp->b_bcount, bp->b_lblkno, bp->b_blkno, bp->b_pblkno, bp->b_dev); + } + } } else { printf("done\n"); /* >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701071010.VAA03372>