OSDN Git Service
(root)
/
qmiga
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
39411cf
)
block/raw-posix: Only sync after successful preallocation
author
Max Reitz
<mreitz@redhat.com>
Tue, 18 Nov 2014 10:23:05 +0000
(11:23 +0100)
committer
Kevin Wolf
<kwolf@redhat.com>
Tue, 18 Nov 2014 11:09:00 +0000
(12:09 +0100)
The loop which filled the file with zeroes may have been left early due
to an error. In that case, the fsync() should be skipped.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/raw-posix.c
patch
|
blob
|
history
diff --git
a/block/raw-posix.c
b/block/raw-posix.c
index
e0e48c5
..
d106fc4
100644
(file)
--- a/
block/raw-posix.c
+++ b/
block/raw-posix.c
@@
-1453,7
+1453,9
@@
static int raw_create(const char *filename, QemuOpts *opts, Error **errp)
}
left -= result;
}
- fsync(fd);
+ if (result >= 0) {
+ fsync(fd);
+ }
g_free(buf);
break;
}