From mboxrd@z Thu Jan 1 00:00:00 1970
From: Pat LaVarre
Subject: Re: zeroes read back more often than appended
Date: 10 Oct 2003 12:15:54 -0600
Sender: linux-fsdevel-owner@vger.kernel.org
Message-ID: <1065809754.3037.105.camel@patehci2>
References: <1065553341.8172.45.camel@patehci2>
<20031007204951.A25423@falcon.csc.calpoly.edu>
<1065732882.5176.14.camel@patehci2> <1065747151.2314.12.camel@patehci2>
<1065803984.3037.7.camel@patehci2>
Mime-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Return-path:
Received: from email-out2.iomega.com ([147.178.1.83]:12196 "EHLO
email.iomega.com") by vger.kernel.org with ESMTP id S263131AbTJJSQJ
(ORCPT );
Fri, 10 Oct 2003 14:16:09 -0400
Received: from royntex01.iomegacorp.com (unknown [147.178.90.120])
by email.iomega.com (Postfix) with ESMTP id 4B3DE1DAB
for ; Fri, 10 Oct 2003 12:16:08 -0600 (MDT)
To: linux-fsdevel@vger.kernel.org
In-Reply-To: <1065803984.3037.7.camel@patehci2>
List-Id: linux-fsdevel.vger.kernel.org
Ahhhhh eventually I did stumble into a context for `dd` that lets me
control its write buffer lengths while writing nonzero bytes ... and yes
that reproduces this issue too. No kernel patch required. No .c app
required. And, curiously, no dmesg complaints from "fs/udf/balloc.c"
"193" "udf_bitmap_free_blocks".
Pat LaVarre
### example tty log
$ time ddudfwh mkudffs 65535 3072
Linux 2.6.0-test7 i686
/mnt/hda11
dd if=/dev/zero of=dd.bin bs=1M seek=0 count=256 2>/dev/null
-rw-rw-r-- 1 pat pat 268435456 Oct 10 12:11 dd.bin
mkudffs 1.0.0b2 for UDF FS 1.0.0-cvs, 2002/02/09
3072+0 records in
3072+0 records out
3072+0 records in
3072+0 records out
00000000 5e 40 5e 40 5e 40 5e 40 5e 40 5e 40 5e 40 5e 40 |^@^@^@^@^@^@^@^@|
*
002bd000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
real 0m41.294s
user 0m5.032s
sys 0m6.528s
$
### script udfddwh
#!/bin/bash
uname -msr
pwd
rm dd.bin
cmd='dd if=/dev/zero of=dd.bin bs=1M seek=255 count=1'
cmd='dd if=/dev/zero of=dd.bin bs=1M seek=0 count=256'
echo "$cmd 2>/dev/null"
$cmd 2>/dev/null
ls -l dd.bin
sudo losetup /dev/loop0 dd.bin
sudo $1 2>&1 | head -1
sudo $1 /dev/loop0 >/dev/null
sudo mount /dev/loop0 /mnt/loop0
sudo chown `id -u`:`id -g` /mnt/loop0/.
dmesg >1.dmesg
cd /mnt/loop0
dd bs=$2 count=$3 if=/dev/zero | cat -e >$OLDPWD/nz.bin
dd if=$OLDPWD/nz.bin of=wh.bin bs=$2 count=$3
# rm $OLDPWD/nz.bin
hexdump -C wh.bin | head -3
cd -
dmesg >2.dmesg
diff -u 1.dmesg 2.dmesg | grep '^\+' | head -5
rm 1.dmesg 2.dmesg
sudo umount /mnt/loop0
sudo losetup -d /dev/loop0
###