xfs
[Top] [All Lists]

Re: disable preallocation

To: Ming Zhang <mingz@xxxxxxxxxxx>
Subject: Re: disable preallocation
From: Iustin Pop <iusty@xxxxxxxxx>
Date: Wed, 19 Apr 2006 01:29:20 +0200
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <1145401592.8601.211.camel@xxxxxxxxxxxxxxxxxxxxx>
Mail-followup-to: Ming Zhang <mingz@xxxxxxxxxxx>, linux-xfs@xxxxxxxxxxx
References: <1145391567.8601.183.camel@xxxxxxxxxxxxxxxxxxxxx> <20060418214252.GA3300@xxxxxxxxxxxxxxxxx> <1145397286.8601.202.camel@xxxxxxxxxxxxxxxxxxxxx> <20060418223553.GB3300@xxxxxxxxxxxxxxxxx> <1145401592.8601.211.camel@xxxxxxxxxxxxxxxxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.11+cvs20060403
On Tue, Apr 18, 2006 at 07:06:32PM -0400, Ming Zhang wrote:
> ;) if that block is preserved already, what happen when there is a read
> on that LBA? read return 0 or read from preserved block?
> 
> assume i write LBA 0 4KB and then ext2 preserve LBA 8-16 for this file,
> then a read on that will return what?

So - you have a new file. You write 4KB at offset 0. ext2, behind your
back, as an optimisation, will pre-allocate space the next three blocks
(from 4097 to 16385). 

And now you try to read them. You will not get 0, you will not get
random data, you will get EOF. Simple as that - preallocation is an
optimisation which is transparent to the userspace. Since you did not
write that data, you are not able to read it. Not as 0, not as random.

At least, that's how I understand thing works :)

Iustin


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