]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
fsync new storage volumes even if new volume was copied.
authorLaine Stump <laine@laine.org>
Mon, 19 Jul 2010 22:59:07 +0000 (18:59 -0400)
committerLaine Stump <laine@laine.org>
Tue, 20 Jul 2010 01:01:28 +0000 (21:01 -0400)
commite0f26c46ae2ad0ba71b8c5872824d85c5cefff54
tree3f4bdb5995a0c19c8df744a19783373f50dbf2b6
parent35bebb57824d6addd158c286d07fa07236187aa1
fsync new storage volumes even if new volume was copied.

Originally the storage volume files were opened with O_DSYNC to make
sure they were flushed to disk immediately. It turned out that this
was extremely slow in some cases, so the O_DSYNC was removed in favor
of just calling fsync() after all the data had been written. However,
this call to fsync was inside the block that is executed to zero-fill
the end of the volume file. In cases where the new volume is copied
from an old volume, and they are the same length, this fsync would
never take place.

Now the fsync is *always* done, unless there is an error (in which
case it isn't important, and is most likely inappropriate.
src/storage/storage_backend.c