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 1630037 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 (under MIT license)
parallel-falloc-and-pwrite.c (text/x-csrc), 2.92 KB, created by
Hanna Czenczek
on 2019-10-29 07:33:41 UTC
(
hide
)
Description:
Test program to demonstrate the issue (under MIT license)
Filename:
MIME Type:
Creator:
Hanna Czenczek
Created:
2019-10-29 07:33:41 UTC
Size:
2.92 KB
patch
obsolete
>/* > * Test for concurrent fallocate() and AIO pwrite, where both are beyond the > * EOF and the pwrite area lies after the fallocate() area > * > * Copyright (c) 2019 Max Reitz > * > * Permission is hereby granted, free of charge, to any person obtaining a copy > * of this software and associated documentation files (the "Software"), to deal > * in the Software without restriction, including without limitation the rights > * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > * copies of the Software, and to permit persons to whom the Software is > * furnished to do so, subject to the following conditions: > * > * The above copyright notice and this permission notice shall be included in all > * copies or substantial portions of the Software. > * > * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE > * SOFTWARE. > */ > > >#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