FreeBSD Bugzilla – Attachment 174200 Details for
Bug 212245
ZFS volume (zvol) does not honor fsync() with sync=standard
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Program used to reproduce the issue
synctest.c (text/plain), 1.29 KB, created by
Asbjørn
on 2016-08-29 18:24:19 UTC
(
hide
)
Description:
Program used to reproduce the issue
Filename:
MIME Type:
Creator:
Asbjørn
Created:
2016-08-29 18:24:19 UTC
Size:
1.29 KB
patch
obsolete
>#include <sys/types.h> >#include <sys/stat.h> >#include <sys/errno.h> >#include <fcntl.h> >#include <stdio.h> >#include <unistd.h> >#include <errno.h> > >int main() >{ > int fd; > char outputFilename[] = "output.txt"; > int counter; > char buffer[200]; > int len; > int written; > > fd = open(outputFilename, O_WRONLY | O_CREAT | O_TRUNC); > > if (fd == -1) { > fprintf(stderr, "Error %d opening output file %s\n", errno, outputFilename); > return 1; > } > > counter = 0; > while (1) > { > counter++; > > len = snprintf(buffer, sizeof(buffer), "%d\n", counter); > > written = 0; > while (len > 0) > { > written = write(fd, buffer, len); > if (written < 0) > { > fprintf(stderr, "I/O error performing write: %d\n", errno); > return 2; > } > len -= written; > } > > if (fsync(fd) != 0) > { > if (errno == EIO) > fprintf(stderr, "I/O error performing fsync: %d\n", errno); > else > fprintf(stderr, "Invalid file descriptor to fsync(): %d\n", errno); > return 3; > } > > fprintf(stdout, "%s", buffer); > } > > close(fd); > > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 212245
: 174200 |
174201