kern/89991: softupdates with mount -ur causes fs UNREFS

fbsd user freebsd-fs at FreeBSD.org
Mon Dec 5 21:10:07 GMT 2005


>Number:         89991
>Category:       kern
>Synopsis:       softupdates with mount -ur causes fs UNREFS
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 05 21:10:02 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     fbsd user
>Release:        RELENG_4 20051028
>Organization:
>Environment:
FreeBSD 4.11-STABLE #0: Fri Oct 28 00:24:59 EDT 2005 i386

>Description:

cd /

fsck -fy /.../<some_mountpoint>
 [passes check with no issues]

dd if=/dev/urandom of=/.../<some_mountpoint>/blah bs=1m count=1

fstat -f /.../<some_mountpoint>
 [nothing listed, ever, it's bulk storage]

sync ; sync ; sync ; sync ; sync ; sync ;
sleep 60
sync ; sync ; sync ; sync ; sync ; sync ;

# done back to back immediately with no wait exactly as shown
rm /.../<some_mountpoint>/blah ; mount -uvr /.../<some_mountpoint>

sync ; sync ; sync ; sync ; sync ; sync ;
sleep 60
sync ; sync ; sync ; sync ; sync ; sync ;

fsck -fy /.../<some_mountpoint>
 ** Phase 4 - Check Reference Counts
 UNREF FILE I=395362  OWNER=foo MODE=100644
 SIZE=1048576 MTIME=Dec  5 14:59 2005 
 CLEAR? yes
 ** Phase 5 - Check Cyl groups
 FREE BLK COUNT(S) WRONG IN SUPERBLK
 SALVAGE? yes
 SUMMARY INFORMATION BAD
 SALVAGE? yes
 BLK(S) MISSING IN BIT MAPS
 SALVAGE? yes
 42491 files, 1643698 used, 1066635 free (2707 frags, 132991 blocks, 0.1% fragmentation)
 ***** FILE SYSTEM WAS MODIFIED *****

fsck -fy /.../<some_mountpoint>
 [passes check with no issues]

=======================================================================

INFO...
dumpfs /.../<some_mountpoint> | head -22
magic   11954   time    Mon Dec  5 15:01:17 2005
id      [ 43667f05 32b73fdf ]
cylgrp  dynamic inodes  4.4BSD
nbfree  132991  ndir    1648    nifree  636035  nffree  2707
ncg     31      ncyl    2689    size    2753246 blocks  2710333
bsize   16384   shift   14      mask    0xffffc000
fsize   2048    shift   11      mask    0xfffff800
frag    8       shift   3       fsbtodb 2
cpg     89      bpg     11392   fpg     91136   ipg     21888
minfree 8%      optim   time    maxcontig 7     maxbpg  4096
rotdelay 0ms    rps     60
ntrak   1       nsect   4096    npsect  4096    spc     4096
symlinklen 60   trackskew 0     interleave 1    contigsumsize 7
nindir  4096    inopb   128     nspf    4       maxfilesize     1126174852055039
sblkno  8       cblkno  16      iblkno  24      dblkno  1392
sbsize  2048    cgsize  16384   cgoffset 1024   cgmask  0xffffffff
csaddr  1392    cssize  2048    shift   10      mask    0xfffffc00
cgrotor 1       fmod    0       ronly   0       clean   1
avgfpdir 64     avgfilesize 16384
flags   soft-updates 
(no rotational position table)

df -ik /.../<some_mountpoint>
Filesystem 1K-blocks    Used   Avail Capacity iused  ifree %iused  Mounted on
/dev/ad1h    5420666 3287396 1699618    66%   42491 636035    6%   /.../<some_mountpoint>

disklabel -r /dev/ad1h
# /dev/ad1c:
type: unknown
disk: amnesiac
label: 
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 19767
sectors/unit: 19925880
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # milliseconds
track-to-track seek: 0  # milliseconds
drivedata: 0 
8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  c: 19925880        0    unused        0     0         # (Cyl.    0 - 19767*)
  f:  6291456        0    4.2BSD     2048 16384    89   # (Cyl.    0 - 6241*)
  g:  2621440  6291456    4.2BSD     2048 16384    91   # (Cyl. 6241*- 8842*)
  h: 11012984  8912896    4.2BSD     2048 16384    89   # (Cyl. 8842*- 19767*)

dmesg -a | egrep ad1
ad1: success setting UDMA2 on Intel chip
ad1: <ST310210A/3.12> ATA-4 disk at ata0-slave
ad1: 9729MB (19925880 sectors), 19767 C, 16 H, 63 S, 512 B
ad1: 16 secs/int, 1 depth queue, UDMA33
ad1: piomode=4 dmamode=2 udmamode=4 cblid=1

newfs -N -U /dev/ad1h
Warning: Block size and bytes per inode restrict cylinders per group to 89.
Warning: 1160 sector(s) in last cylinder unallocated
/dev/ad1h:      11012984 sectors in 2689 cylinders of 1 tracks, 4096 sectors
        5377.4MB in 31 cyl groups (89 c/g, 178.00MB/g, 21888 i/g) SOFTUPDATES
super-block backups (for fsck -b #) at:
 32, 364576, 729120, ...

tunefs -p /dev/ad1h
tunefs: soft updates:  (-n)                                enabled
tunefs: maximum contiguous block count: (-a)               7
tunefs: rotational delay between contiguous blocks: (-d)   0 ms
tunefs: maximum blocks per file in a cylinder group: (-e)  4096
tunefs: average file size: (-f)                            16384
tunefs: average number of files in a directory: (-s)       64
tunefs: minimum percentage of free space: (-m)             8%
tunefs: optimization preference: (-o)                      time

fdisk ad1
******* Working on device /dev/ad1 *******
parameters extracted from in-core disklabel are:
cylinders=19767 heads=16 sectors/track=63 (1008 blks/cyl)
Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=19767 heads=16 sectors/track=63 (1008 blks/cyl)
fdisk: invalid fdisk partition table found
Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
<UNUSED>
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
sysid 165,(FreeBSD/NetBSD/386BSD)
    start 63, size 19925073 (9729 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 310/ head 15/ sector 63

ffsinfo /dev/ad1h
 [skipped]

in kernel but not being used.
 options QUOTA

occurs with multiple filesystems here, different machines, same kernel/world.

>How-To-Repeat:

repeat the above.
>Fix:

flush buffers before remounting read-only?

test/verify the following...
 affects plain/forced mount/umount?
 affects RELENG_4/5/6/HEAD?
 UFS1 vs. UFS2, etc?
 without softupdates?

will update this pr as/if answers to the above
become known.

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list