2010-08-03 10:58:24

by Bo Branten

[permalink] [raw]
Subject: persistent preallocation


Hello,

I have a question on the implementation of persistent preallocation, the
reason to not return the disk block is because it can contain old data but
I wonder if an implementation has to return zeros instead or if it could
return any garbage as long as it is not _that_ garbage?

Bo Branten



2010-08-03 11:18:33

by Dmitry Monakhov

[permalink] [raw]
Subject: Re: persistent preallocation

Bo Brantén <[email protected]> writes:

> Hello,
>
> I have a question on the implementation of persistent preallocation,
> the reason to not return the disk block is because it can contain old
> data but I wonder if an implementation has to return zeros instead or
Please look at fallocate(2) syscall.
> if it could return any garbage as long as it is not _that_ garbage?
Off course it is not a garbage, it is old user's data which may be
very very useful (old passwords, cookies, and etc)for person who has
time to analyze it :)
>
> Bo Branten
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

2010-08-03 16:26:07

by Eric Sandeen

[permalink] [raw]
Subject: Re: persistent preallocation

On 08/03/2010 06:18 AM, Dmitry Monakhov wrote:
> Bo Brantén <[email protected]> writes:
>
>> Hello,
>>
>> I have a question on the implementation of persistent preallocation,
>> the reason to not return the disk block is because it can contain old
>> data but I wonder if an implementation has to return zeros instead or
> Please look at fallocate(2) syscall.
>> if it could return any garbage as long as it is not _that_ garbage?
> Off course it is not a garbage, it is old user's data which may be
> very very useful (old passwords, cookies, and etc)for person who has
> time to analyze it :)

I think the question was, could the implementation return 0xFF rather
than what is actually on disk (and rather than 0's) when reading a
preallocated block.

You could certainly write it that way, but I don't know why you would
want to...

IOW it wouldn't be posix_fallocate() or fallocate(), it'd be
junk_preallocate() or something.

-Eric

>>
>> Bo Branten
>>

2010-08-03 18:36:18

by Theodore Ts'o

[permalink] [raw]
Subject: Re: persistent preallocation

On Tue, Aug 03, 2010 at 12:58:21PM +0200, Bo Brant?n wrote:
>
> I have a question on the implementation of persistent preallocation,
> the reason to not return the disk block is because it can contain
> old data but I wonder if an implementation has to return zeros
> instead or if it could return any garbage as long as it is not
> _that_ garbage?

What would be the point? If we know that we can't return the on-disk
block contents, returning all zero's is much nicer for the application
since it also then looks like and works just like a sparse file.

- Ted