Re: bus error when disk is full, with mmap & sparse file

Richard Laager <[email protected]> Thu, 02 Feb 2012 01:22:34 -0600
Newsgroups gmane.comp.db.rrdtool.devel
Message-ID <1328167354.3572.18.camel__26754.3714879595$1328167373$gmane$org@watermelon.coderich.net>
On Thu, 2012-02-02 at 01:11 -0600, Richard Laager wrote:
> On Thu, 2012-02-02 at 07:22 +0100, Tobias Oetiker wrote:
> > * with the patch, we get performance and a sort of thin provisioning (files
> >   with holes).
> 
> fallocate() does not create holes. From fallocate(2), "After a
> successful call, subsequent writes into this range are guaranteed not to
> fail because of lack of disk space."
> 
> fallocate() is Linux-specific. The portable equivalent is
> posix_fallocate(). On Linux, that does much the same thing as with this
> patch; it tries fallocate() first and then falls back to zero-filling.
> I'm not sure if that zero filling code performs better or worse than
> your mmap() code.

FWIW, libvirt apparently calls posix_fallocate() #ifdef
HAVE_POSIX_FALLOCATE. Otherwise, #ifdef HAVE_MMAP, it does mmap() + one
memset(). Without HAVE_MMAP, it write()s in 1 MiB blocks.

-- 
Richard

_______________________________________________
rrd-developers mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEABECAAYFAk8qObUACgkQbfU6uV4fG87umQCfd77fDFD3FkFJcbtMF56WrLyb
3F0An1yStXm8hLaa5mF5ysO7NBrIZDCh
=+S1E
-----END PGP SIGNATURE-----