Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 302444 Details for
Bug 438423
backport patch to RHEL5 have it flip to synchronous writes when there is a write error
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
reproducer 2
write-simple.c (text/plain), 1.63 KB, created by
Jeff Layton
on 2008-04-15 12:38:55 UTC
(
hide
)
Description:
reproducer 2
Filename:
MIME Type:
Creator:
Jeff Layton
Created:
2008-04-15 12:38:55 UTC
Size:
1.63 KB
patch
obsolete
>#include <stdio.h> >#include <stdlib.h> >#include <sys/types.h> >#include <sys/stat.h> >#include <fcntl.h> >#include <errno.h> >#include <unistd.h> >#include <sys/vfs.h> > >/* use blocksize equal to wsize */ >#define BUFSZ 32768 > > >/* > * write specified number of kbytes to given filename, and then do a > * fsync to make sure the writes are flushed. Then, try to write 1k > * more and check the return value to make sure it errors out. Should > * be run with a number of kbytes which is more than the amount of > * space on the destination filesystem > */ >int >main(int argc, char **argv) >{ > char *buf; > int fd, err; > ssize_t written, total_written, filesize; > > if (argc < 3) { > printf("Usage: %s filename bytes\n", argv[0]); > return 1; > } > > filesize = atol(argv[2]); > > buf = calloc(1, BUFSZ); > if (buf == NULL) { > printf("calloc failed: %d\n", -ENOMEM); > return -ENOMEM; > } > > fd = open(argv[1], O_WRONLY|O_CREAT|O_TRUNC, 0600); > if (fd < 0) { > printf("open failed: %d\n", -errno); > return -errno; > } > > printf("Attempting to write %ld byte file to %s\n", filesize, argv[1]); > > total_written = 0; > while (total_written < filesize) { > written = write(fd, buf, BUFSZ); > if (written < 0) { > if (errno == ENOSPC) { > printf("write: ENOSPC after writing %ld bytes\n", > total_written); > return 0; > } else { > printf("write: error %d while writing\n", errno); > return 1; > } > } > total_written += written; > } > > printf("Entire file written\n"); > > err = fsync(fd); > if (err < 0) { > printf("fsync: error %d\n", errno); > return 1; > } > > err = close(fd); > if (err < 0) { > printf("close: error %d\n", errno); > return 1; > } > > printf("no errors at all!\n"); > return 1; >}
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 438423
:
298747
|
299375
|
299887
| 302444