Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 1629144 Details for
Bug 1765547
Fallocate on XFS may discard concurrent AIO write
Home
New
Search
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.rh90 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
Test program to demonstrate the issue
parallel-falloc-and-pwrite.c (text/plain), 1.69 KB, created by
Hanna Czenczek
on 2019-10-25 11:47:27 UTC
(
hide
)
Description:
Test program to demonstrate the issue
Filename:
MIME Type:
Creator:
Hanna Czenczek
Created:
2019-10-25 11:47:27 UTC
Size:
1.69 KB
patch
obsolete
>#define _GNU_SOURCE > >#include <assert.h> >#include <fcntl.h> >#include <libaio.h> >#include <pthread.h> >#include <stdio.h> >#include <stdlib.h> >#include <string.h> >#include <unistd.h> > >// Define this to perform the fallocate and the pwrite sequentially >// instead of in parallel > >// #define IN_ORDER > > >int fd; > >void *falloc_thread(void *arg) >{ > int ret; > > (void)arg; > > puts("starting fallocate"); > > ret = fallocate(fd, 0, 0, 4096); > assert(ret == 0); > > puts("fallocate done"); > > return NULL; >} > >int main(int argc, char *argv[]) >{ > pthread_t falloc_thr; > int ret; > > if (argc != 2) { > fprintf(stderr, "Usage: %s <scratch file>\n", argv[0]); > return 1; > } > > fd = open(argv[1], O_CREAT | O_RDWR | O_TRUNC | O_DIRECT, 0666); > assert(fd >= 0); > > void *buf = aligned_alloc(4096, 4096); > memset(buf, 42, 4096); > > io_context_t ctx = 0; > ret = io_setup(1, &ctx); > assert(ret == 0); > > ret = pthread_create(&falloc_thr, NULL, &falloc_thread, NULL); > assert(ret == 0); > >#ifdef IN_ORDER > ret = pthread_join(falloc_thr, NULL); > assert(ret == 0); >#endif > > struct iocb ior; > io_prep_pwrite(&ior, fd, buf, 4096, 4096); > > puts("submitting pwrite"); > > struct iocb *ios[] = { &ior }; > ret = io_submit(ctx, 1, ios); > assert(ret == 1); > > struct io_event evs[1]; > ret = io_getevents(ctx, 1, 1, evs, NULL); > assert(ret == 1); > > puts("pwrite done"); > >#ifndef IN_ORDER > ret = pthread_join(falloc_thr, NULL); > assert(ret == 0); >#endif > > ret = io_destroy(ctx); > assert(ret == 0); > > close(fd); > free(buf); > > puts("\nHexdump should show 4k of 0s and 4k of 42s:\n"); > > execlp("hexdump", "hexdump", "-C", argv[1], NULL); > 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 Raw
Actions:
View
Attachments on
bug 1765547
:
1629144
|
1630037