xfs
[Top] [All Lists]

Re: [PATCH 4/5] ext4: fallocate support in ext4

To: Jeff Garzik <jeff@xxxxxxxxxx>
Subject: Re: [PATCH 4/5] ext4: fallocate support in ext4
From: Andreas Dilger <adilger@xxxxxxxxxxxxx>
Date: Mon, 7 May 2007 18:07:36 -0700
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, "Amit K. Arora" <aarora@xxxxxxxxxxxxxxxxxx>, linux-fsdevel@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-ext4@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx, suparna@xxxxxxxxxx, cmm@xxxxxxxxxx
In-reply-to: <463FB008.3080706@xxxxxxxxxx>
Mail-followup-to: Jeff Garzik <jeff@xxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, "Amit K. Arora" <aarora@xxxxxxxxxxxxxxxxxx>, linux-fsdevel@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-ext4@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx, suparna@xxxxxxxxxx, cmm@xxxxxxxxxx
References: <20070420135146.GA21352@xxxxxxxxxxxxxxxxxxxx> <20070420145918.GY355@xxxxxxxxxxxxxxxxxxxxxxxx> <20070424121632.GA10136@xxxxxxxxxxxxxxxxxxxx> <20070426175056.GA25321@xxxxxxxxxxxxxxxxxxxx> <20070426181332.GD7209@xxxxxxxxxxxxxxxxxxxx> <20070503213133.d1559f52.akpm@xxxxxxxxxxxxxxxxxxxx> <20070507113753.GA5439@xxxxxxxxxxxxxxxxxxxx> <20070507135825.f8545a65.akpm@xxxxxxxxxxxxxxxxxxxx> <20070507222103.GJ8181@xxxxxxxxxxxxxxxxxxxx> <463FB008.3080706@xxxxxxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.4.1i
On May 07, 2007  19:02 -0400, Jeff Garzik wrote:
> Andreas Dilger wrote:
> >Actually, this is a non-issue.  The reason that it is handled for 
> >extent-only is that this is the only way to allocate space in the
> >filesystem without doing the explicit zeroing.
> 
> Precisely /how/ do you avoid the zeroing issue, for extents?
> 
> If I posix_fallocate() 20GB on ext4, it damn well better be zeroed, 
> otherwise the implementation is broken.

In ext4 (as in XFS) there is a flag stored in the extent that tells if
the extent is initialized or not.  Reads from uninitialized extents will
return zero-filled data, and writes that don't span the whole extent
will cause the uninitialized extent to be split into a regular extent
and one or two uninitialized extents (depending where the write is).

My comment was just that the extent doesn't have to be explicitly zero
filled on the disk, by virtue of the fact that the uninitialized flag
will cause reads to return zero.

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.


<Prev in Thread] Current Thread [Next in Thread>