From owner-freebsd-current@FreeBSD.ORG Mon Feb 18 19:08:12 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D80016A473 for ; Mon, 18 Feb 2008 19:08:12 +0000 (UTC) (envelope-from gavin.atkinson@ury.york.ac.uk) Received: from mail-gw2.york.ac.uk (mail-gw2.york.ac.uk [144.32.128.247]) by mx1.freebsd.org (Postfix) with ESMTP id B841413C4E1 for ; Mon, 18 Feb 2008 19:08:11 +0000 (UTC) (envelope-from gavin.atkinson@ury.york.ac.uk) Received: from mail-gw7.york.ac.uk (mail-gw7.york.ac.uk [144.32.129.30]) by mail-gw2.york.ac.uk (8.13.6/8.13.6) with ESMTP id m1IIba5e013288; Mon, 18 Feb 2008 18:37:36 GMT Received: from buffy-128.york.ac.uk ([144.32.128.160] helo=buffy.york.ac.uk) by mail-gw7.york.ac.uk with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1JRArw-0003RK-KD; Mon, 18 Feb 2008 18:37:36 +0000 Received: from buffy.york.ac.uk (localhost [127.0.0.1]) by buffy.york.ac.uk (8.14.2/8.14.2) with ESMTP id m1IIbaWY058328; Mon, 18 Feb 2008 18:37:36 GMT (envelope-from gavin.atkinson@ury.york.ac.uk) Received: (from ga9@localhost) by buffy.york.ac.uk (8.14.2/8.14.2/Submit) id m1IIbaDu058327; Mon, 18 Feb 2008 18:37:36 GMT (envelope-from gavin.atkinson@ury.york.ac.uk) X-Authentication-Warning: buffy.york.ac.uk: ga9 set sender to gavin.atkinson@ury.york.ac.uk using -f From: Gavin Atkinson To: Richard Todd In-Reply-To: <20080215231507.EAB7D641@mx2.synetsystems.com> References: <20080215231507.EAB7D641@mx2.synetsystems.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Mon, 18 Feb 2008 18:37:35 +0000 Message-Id: <1203359855.43782.60.camel@buffy.york.ac.uk> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 FreeBSD GNOME Team Port X-York-MailScanner: Found to be clean X-York-MailScanner-From: gavin.atkinson@ury.york.ac.uk Cc: freebsd-current@freebsd.org Subject: Re: ZFS: data sometimes not getting correctly flushed to disk (possible mmap/write issue)? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2008 19:08:12 -0000 On Fri, 2008-02-15 at 16:59 -0600, Richard Todd wrote: > Bit of a long story behind this one: I've been playing with the "picard" > program in ports to do re-tagging of audio (mp3/ogg) files, and was having > problems with the tagging process creating corrupted .ogg files. On > further investigation trying to debug this, I found that the "picard" > program seemed to be correctly writing the files if I checked them > immediately, but the files were corrupt when I looked at them later. > Further investigation and coming up with test cases brought me to the > surprising conclusion that ZFS was to blame -- under certain conditions ZFS > seems not to be writing all the data in the file out to disk correctly. > The file appears to be good only so long as the file's data is in cache, but > the data actually on disk doesn't match what's in cache. I don't currently have a system that I can test this with, but is there any chance you could make the following change to your script? #!/bin/sh NAME=$1 LEN=$2 rm $NAME ./a.out $NAME $LEN ./gen2.py $NAME md5 $NAME + cp $NAME /some/ufs/filesystem/$NAME.1 ls -l $NAME sudo umount /u3 sudo mount -t zfs u3 /u3 md5 $NAME + cp $NAME /some/ufs/filesystem/$NAME.2 ls -l $NAME + md5 /some/ufs/filesystem/$NAME.? and when you find files that differ, compare the two copies stored on the UFS filesystem with cmp(1)? I'd be interested to know exactly what the corruption looks like - is a single bit differen? Or was an entire page destroyed? Gavin Gavin