projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
263180d
)
t/io_uring: check read of home node file
io_uring-numa
author
Jens Axboe
<axboe@kernel.dk>
Tue, 2 Aug 2022 15:56:25 +0000
(09:56 -0600)
committer
Jens Axboe
<axboe@kernel.dk>
Tue, 2 Aug 2022 16:09:10 +0000
(10:09 -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 ea70204340a45ff198c2d00238f3f83587e521d6..35bf195644e195d6cb28790fdee09cc58aba499b 100644
(file)
--- a/
t/io_uring.c
+++ b/
t/io_uring.c
@@
-641,14
+641,18
@@
static int detect_node(struct submitter *s, const char *name)
#ifdef CONFIG_LIBNUMA
const char *base = basename(name);
char str[128];
- int fd, node;
+ int
ret,
fd, node;
sprintf(str, "/sys/block/%s/device/numa_node", base);
fd = open(str, O_RDONLY);
if (fd < 0)
return -1;
- read(fd, str, sizeof(str));
+ ret = read(fd, str, sizeof(str));
+ if (ret < 0) {
+ close(fd);
+ return -1;
+ }
node = atoi(str);
s->numa_node = node;
close(fd);