qfile-unpacker: do not call fdatasync() at each file (#1257)
POSIX requires that a read(2) which can be proved to occur after a write() has returned returns the new data. We want here only that other processes in the same VM will see the file either fully written, or not see it at all. So ensuring that linkat(2) is called after write is completed should be enough. Fixes QubesOS/qubes-issues#1257
This commit is contained in:
parent
e745b87939
commit
c1d42f1602
@ -137,7 +137,6 @@ void process_one_file_reg(struct file_header *untrusted_hdr,
|
|||||||
else
|
else
|
||||||
do_exit(errno, untrusted_name);
|
do_exit(errno, untrusted_name);
|
||||||
}
|
}
|
||||||
fdatasync(fdout);
|
|
||||||
if (use_tmpfile) {
|
if (use_tmpfile) {
|
||||||
char fd_str[7];
|
char fd_str[7];
|
||||||
snprintf(fd_str, sizeof(fd_str), "%d", fdout);
|
snprintf(fd_str, sizeof(fd_str), "%d", fdout);
|
||||||
|
Loading…
Reference in New Issue
Block a user