[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] maint: avoid reading lots of data from /dev/urandom
From: |
Pádraig Brady |
Subject: |
Re: [PATCH] maint: avoid reading lots of data from /dev/urandom |
Date: |
Tue, 24 Apr 2012 13:15:24 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0 |
On 04/24/2012 12:53 PM, Bernhard Voelker wrote:
>
>
> On 04/24/2012 01:15 PM, Pádraig Brady wrote:
>>> With those changes, the affected files are then very compressible.
>>>> With some file system types/options, won't they occupy far fewer
>>>> blocks than before?
>> Good point.
>> The dd/sparse one could then fail the alloc check.
>> The fiemap-empty change is only 5120 bytes too.
>
> Wouldn't
>
> -dd count=10 if=/dev/urandom conv=notrunc iflag=fullblock
> of=unwritten.withdata
> +dd count=10 if=/dev/zero | sed 's/\(.\)./\1 /g' | dd conv=notrunc
> of=unwritten.withdata
>
> defeat the compression logic?
You'd have to be approaching random to avoid compression.
$ dd count=10 if=/dev/zero | tr '\0' 1 | gzip -c | wc -c
41
$ dd count=10 if=/dev/zero | sed 's/\(.\)./\1 /g' | gzip -c | wc -c
41
cheers,
Pádraig.