projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
ebd9b4d
)
t/io_uring: avoid truncation of offset on 32-bit builds
author
Jens Axboe
<axboe@kernel.dk>
Tue, 14 Mar 2023 19:58:13 +0000
(13:58 -0600)
committer
Jens Axboe
<axboe@kernel.dk>
Tue, 14 Mar 2023 19:58:13 +0000
(13:58 -0600)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
t/io_uring.c
patch
|
blob
|
blame
|
history
diff --git
a/t/io_uring.c
b/t/io_uring.c
index 1ea0a9da29b6444ab66d9794940677c5e87f2475..d39d7924b4e4149549c6b2f83e4639bc16111f87 100644
(file)
--- a/
t/io_uring.c
+++ b/
t/io_uring.c
@@
-530,8
+530,11
@@
static unsigned long long get_offset(struct submitter *s, struct file *f)
long r;
if (random_io) {
+ unsigned long long block;
+
r = __rand64(&s->rand_state);
- offset = (r % (f->max_blocks - 1)) * bs;
+ block = r % f->max_blocks;
+ offset = block * (unsigned long long) bs;
} else {
offset = f->cur_off;
f->cur_off += bs;