projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
t/io_uring: stop when max number of files is reached
[fio.git]
/
t
/
io_uring.c
diff --git
a/t/io_uring.c
b/t/io_uring.c
index 7c75c887eb4f511616dfdba9fa48068e23832dd7..c7139f8728249c4dae24831da1890299d439750e 100644
(file)
--- a/
t/io_uring.c
+++ b/
t/io_uring.c
@@
-501,13
+501,19
@@
int main(int argc, char *argv[])
i = 1;
while (!do_nop && i < argc) {
i = 1;
while (!do_nop && i < argc) {
- struct file *f
= &s->files[s->nr_files]
;
+ struct file *f;
+ if (s->nr_files == MAX_FDS) {
+ printf("Max number of files (%d) reached\n", MAX_FDS);
+ break;
+ }
fd = open(argv[i], flags);
if (fd < 0) {
perror("open");
return 1;
}
fd = open(argv[i], flags);
if (fd < 0) {
perror("open");
return 1;
}
+
+ f = &s->files[s->nr_files];
f->real_fd = fd;
if (get_file_size(f)) {
printf("failed getting size of device/file\n");
f->real_fd = fd;
if (get_file_size(f)) {
printf("failed getting size of device/file\n");