From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josef Bacik Subject: Re: ext3 block layout after deleting previous drive contents Date: Tue, 8 Apr 2008 13:08:09 -0400 Message-ID: <20080408170809.GP22429@unused.rdu.redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-fsdevel@vger.kernel.org To: "Bock, Tony" Return-path: Received: from mx1.redhat.com ([66.187.233.31]:43104 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753537AbYDHRP2 (ORCPT ); Tue, 8 Apr 2008 13:15:28 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 the 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 throug= hout several files. =A0As long as we don't re-wipe the drive, these del= ays occur at repeatable offsets within the affected files, suggesting d= isk seeks at the affected locations. >=20 > To my understanding, deleting a file should mark all the data blocks = as free. =A0Thus, any previous disk state should no longer affect files= that are written thereafter. =A0Is this correct? > As a general rule you cannot re-use the blocks (in ordered mode anyway)= that are involved in a truncate until the transaction for the truncate is comple= ted in order to make sure that everything is consistent after a recovery in th= e case of a crash. So if you are rm -rf *'ing and then immediately re-writing st= uff 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 then do your writing, that should garuntee that = the blocks that you have freed up from the truncate are actually able to be= used by new stuff. Thanks much, Josef=20 -- 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