From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Dilger Subject: Re: ext3 block layout after deleting previous drive contents Date: Mon, 14 Apr 2008 13:46:25 -0600 Message-ID: <20080414194625.GH3106@webber.adilger.int> References: <20080408170809.GP22429@unused.rdu.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: "Bock, Tony" , linux-fsdevel@vger.kernel.org To: Josef Bacik Return-path: Received: from sca-es-mail-2.Sun.COM ([192.18.43.133]:61140 "EHLO sca-es-mail-2.sun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755042AbYDNTqk (ORCPT ); Mon, 14 Apr 2008 15:46:40 -0400 Received: from fe-sfbay-10.sun.com ([192.18.43.129]) by sca-es-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m3EJkd5Z020031 for ; Mon, 14 Apr 2008 12:46:39 -0700 (PDT) Received: from conversion-daemon.fe-sfbay-10.sun.com by fe-sfbay-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0JZB00501YPRAY00@fe-sfbay-10.sun.com> (original mail from adilger@sun.com) for linux-fsdevel@vger.kernel.org; Mon, 14 Apr 2008 12:46:39 -0700 (PDT) In-reply-to: <20080408170809.GP22429@unused.rdu.redhat.com> Content-disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Apr 08, 2008 13:08 -0400, Josef Bacik wrote: > On Tue, Apr 08, 2008 at 09:33:32AM -0700, Bock, Tony wrote: > > Is there any ext3 feature that would cause disk layout to vary if > > one were to delete all the files on disk and then rewrite them in t= he > > same order?=A0 We've been doing some simple read/write file system = tests > > in our lab that sometimes result in short delays being distributed > > throughout several files. =A0As long as we don't re-wipe the drive, > > these delays occur at repeatable offsets within the affected files, > > suggesting disk seeks at the affected locations. > >=20 > > To my understanding, deleting a file should mark all the data block= s > > as free. =A0Thus, any previous disk state should no longer affect f= iles > > that are written thereafter. =A0Is this correct? >=20 > As a general rule you cannot re-use the blocks (in ordered mode anywa= y) > that are involved in a truncate until the transaction for the truncat= e > is completed in order to make sure that everything is consistent afte= r > a recovery in the case of a crash. So if you are rm -rf *'ing and th= en > immediately re-writing stuff you are going to end up with weirdness, = as > there will be blocks that cannot be reused until the entire truncate = is > completed. Best bet is to do you rm -rf * and then run sync, and th= en > do your writing, that should garuntee that the blocks that you have f= reed > up from the truncate are actually able to be used by new stuff. In addition, every 125MB or so there has to be a break in the file data because of metadata. In ext4 with the "flex_bg" patch the metadata wil= l be more localized and spread around 16GB apart (configurable). Cheers, Andreas -- Andreas Dilger Sr. Staff Engineer, Lustre Group Sun Microsystems of Canada, Inc. -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html