lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200811231403.BHG87011.OFOOQFHVJLFSMt@I-love.SAKURA.ne.jp>
Date:	Sun, 23 Nov 2008 14:03:24 +0900
From:	Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
To:	phillip@...gher.demon.co.uk
Cc:	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: Zero-clearing all zero-clearable bytes.

Hello.

Phillip Lougher wrote:
> Most filesystems will not create a sparse file if zero-byte filled 
> blocks are written.  To create a sparse file you normally have to seek 
> beyond the file end and then write blocks, leaving a hole in-between the 
> positions.
> 
> The information from stat can tell you if a file has been stored 
> sparsely, because the blocks used count will be less than the file size 
> suggests.
>
Then, I can use "dd if=/dev/zero" without worrying sparse files.

Phillip Lougher wrote:
> You don't mention what you're using to compress the ext3 image file.  If 
> you're using Squashfs then it's much better to zero-fill the blocks 
> rather than use 255, because Squashfs detects zero-filled blocks and 
> stores them sparsely.  This not only gets slightly better compression 
> (than a compressed zero-filled block), but reading is also slightly faster.
> 
Yes, I use squashfs.



What I wanted to do is "Zero-clearing *all zero-clearable* bytes".
Suppose blocks for inode are 8192 bytes and only 128 bytes are in use,
I think there are 8064 bytes I can zero-fill.
Suppose blocks for file data are 8192 bytes and a file's size is 1 byte,
I think there are 8191 bytes I can zero-fill.
Such bytes may have non-zero values because directory entries can be
unlink()ed and file data can be truncate()d.
I wished there is a utility to zero-fill such bytes.


Thanks a lot.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ