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 298747 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 program
write-error-test.c (text/plain), 1.27 KB, created by
Jeff Layton
on 2008-03-20 20:40:19 UTC
(
hide
)
Description:
reproducer program
Filename:
MIME Type:
Creator:
Jeff Layton
Created:
2008-03-20 20:40:19 UTC
Size:
1.27 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> > >#define BUFSZ 1024 > >/* > * 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, kbytes, i; > ssize_t written; > > if (argc < 3) { > printf("Usage: %s filename kbytes\n", argv[0]); > return 1; > } > > kbytes = atoi(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; > } > > for (i = 0; i < kbytes; i++) > write(fd, buf, BUFSZ); > > fsync(fd); > > /* if we've overrun the amount of space, then we should now be > * doing synchronous writes. > */ > written = write(fd, buf, BUFSZ); > if (written < 0) { > printf("success: final write returned error!\n"); > return 0; > } else { > printf("failure: final write did not return error!\n"); > return 1; > } > > 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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 438423
:
298747
|
299375
|
299887
|
302444