zeroes read back more often than appended
Offline recently I was reminded that the default marc archive view of just the last month of linux-fsdevel does not know:
-----Forwarded Message-----
In helping, first we conjecture what may break, then we show what does break, then we (discover and) explain how to fix it. So far, with Linux 2.6 udf.ko, we have published some of what breaks. We see the trivially repeatable demo that:
"Try appending nonzero to multiple files in a round robin sequence, and udf.ko reads back zero in place of the nonzero written. mkfs in place of mkudffs reads back only the nonzero written."
at:
http://marc.theaimsgroup.com/?l=linux-fsdevel&m=106676214111422
List: linux-fsdevel
Subject: Re: zeroes read back more often than appended
Date: 2003-10-21 18:44:54
Pat LaVarre
No improvement in 2.6.0-test10 with CONFIG_SMP = CONFIG_PREEMPT = default = on.
$ uname -msr Linux 2.6.0-test10 i686 $ $ date ; time fswhd 0 768 mkudffs 0xFF600 0xC8 0x1 Wed Nov 26 17:03:48 MST 2003 Linux 2.6.0-test10 i686 /home/pat dd if=/dev/zero of=dd.bin bs=1M seek=0 count=768 2>/dev/null -rw-rw-r-- 1 pat pat 805306368 Nov 26 17:04 dd.bin mkudffs 1.0.0b2 for UDF FS 1.0.0-cvs, 2002/02/09 0 hexdump -C whd0.bin | head -3 00000000 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa |................| * 01f91000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +++ 2.dmesg 2003-11-26 17:05:38.838645504 -0700 +mplete Error } +UDF-fs DEBUG fs/udf/balloc.c:192:udf_bitmap_free_blocks: bit 2728 already set +UDF-fs DEBUG fs/udf/balloc.c:193:udf_bitmap_free_blocks: byte= 1 +UDF-fs DEBUG fs/udf/balloc.c:192:udf_bitmap_free_blocks: bit 2728 already set
real 2m15.777s user 0m2.438s sys 0m6.433s $ $ date ; time fswhd 0 768 mkudffs 0xFF600 0xC8 0x2 Wed Nov 26 17:07:38 MST 2003 Linux 2.6.0-test10 i686 /home/pat dd if=/dev/zero of=dd.bin bs=1M seek=0 count=768 2>/dev/null -rw-rw-r-- 1 pat pat 805306368 Nov 26 17:12 dd.bin mkudffs 1.0.0b2 for UDF FS 1.0.0-cvs, 2002/02/09 0 hexdump -C whd0.bin | head -3 00000000 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa |................| * 01ff0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| hexdump -C whd1.bin | head -3 00000000 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa |................| * 02ffb000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +++ 2.dmesg 2003-11-26 17:17:52.278145752 -0700 +logicalvol: FileSet found in LogicalVolDesc at block=24, partition=0 +UDF-fs DEBUG fs/udf/balloc.c:192:udf_bitmap_free_blocks: bit 13358 already set +UDF-fs DEBUG fs/udf/balloc.c:193:udf_bitmap_free_blocks: byte=40 +UDF-fs DEBUG fs/udf/balloc.c:192:udf_bitmap_free_blocks: bit 13358 already set
real 10m28.744s user 0m7.642s sys 0m10.885s
$
Quoted 2 lines
No improvement in 2.6.0-test10
withCONFIG_SMP=CONFIG_PREEMPT= default = on.
Turning SMP off and PREEMPT off again fixes the case of appending nonzero to a single file, again without improving the case of appending nonzero to two or more files.
Pat LaVarre
P.S. Relevant tty log include:
$ egrep 'CONFIG_(SMP|PREEMPT)' .config # CONFIG_SMP is not set # CONFIG_PREEMPT is not set $ $ egrep '^CONFIG_DEBUG' .config CONFIG_DEBUG_KERNEL=y CONFIG_DEBUG_SLAB=y CONFIG_DEBUG_INFO=y CONFIG_DEBUG_SPINLOCK_SLEEP=y $ $ date; time fswhd 0 768 mkudffs 0xFF600 0xC8 0x2 Fri Nov 28 10:56:18 MST 2003 Linux 2.6.0-10.udf i686 /home/pat dd if=/dev/zero of=dd.bin bs=1M seek=0 count=768 2>/dev/null -rw-rw-r-- 1 pat pat 805306368 Nov 28 10:57 dd.bin mkudffs 1.0.0b2 for UDF FS 1.0.0-cvs, 2002/02/09 0 hexdump -C whd0.bin | head -3 00000000 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa |................| * 06fbc800 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| hexdump -C whd1.bin | head -3 00000000 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa |................| * 06fbb000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +++ 2.dmesg 2003-11-28 10:59:03.434667328 -0700 +DF-fs DEBUG fs/udf/super.c:1085:udf_load_logicalvol: Partition (0:0) type 1 on volume 1 +UDF-fs DEBUG fs/udf/balloc.c:192:udf_bitmap_free_blocks: bit 12 already set +UDF-fs DEBUG fs/udf/balloc.c:193:udf_bitmap_free_blocks: byte=70 +UDF-fs DEBUG fs/udf/balloc.c:192:udf_bitmap_free_blocks: bit 13 already set
real 2m45.760s user 0m7.849s sys 0m7.472s $ $ date; time fswhd 0 768 mkudffs 0xFF600 0xC8 0x1 Fri Nov 28 11:08:59 MST 2003 Linux 2.6.0-10.udf i686 /home/pat dd if=/dev/zero of=dd.bin bs=1M seek=0 count=768 2>/dev/null -rw-rw-r-- 1 pat pat 805306368 Nov 28 11:09 dd.bin mkudffs 1.0.0b2 for UDF FS 1.0.0-cvs, 2002/02/09 0 hexdump -C whd0.bin | head -3 00000000 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa |................| * 0c783000
real 2m12.085s user 0m3.912s sys 0m3.393s
$
// To recap now, next game suggested is:
CONFIG_DEBUG_KERNEL=yCONFIG_DEBUG_INFO=yCONFIG_DEBUG_SLAB=yCONFIG_MAGIC_SYSRQ=y
gdb /usr/src/linux/vmlinux /proc/kcore
// We're motivated to play because when we try
// appending nonzero to files, then we see:
"Two files with mkudffs, reads zeroes from both files ouch."
"One file with mkudffs, ok" if and only if CONFIG_SMP = CONFIG_PREEMPT = off.
"Two files with mkfs in place of mkudffs, ok."
// To reproduce these results involves such
// steps as the following.
//
// Reliably reproducing this trouble as yet
// requires whole minutes of real time from a PC
// that can rebuild the defconfig kernel in
// about six minutes.
http://sourceforge.net/projects/linux-udf/
ftp://members.aol.com/plscsi/linux/udftools-cvs.2003-11-26.tar.gz
mkdir /mnt/loop0
ln -s /sbin/losetup ~/bin
ln -s $PWD/mkudffs ~/bin
cd ~/bin
patch <http://marc.theaimsgroup.com/?l=linux-fsdevel&m=106675517702950
rm tty.txt
gcc -o whd -Wall whd.c
date; time fswhd 767 1 mkudffs 0xFF 0x10 0x2
date; time fswhd 0 768 mkudffs 0xFF600 0xC8 0x2
date; time fswhd 0 768 mkudffs 0xFF600 0xC8 0x1
//
Pat LaVarre