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: use the right check for when to wait
[fio.git]
/
engines
/
e4defrag.c
diff --git
a/engines/e4defrag.c
b/engines/e4defrag.c
index 1e4996f155ef5d258ae98a2a6748701c84e5413c..8f71d02caa947867339d980e0f2722c9a5751b8d 100644
(file)
--- a/
engines/e4defrag.c
+++ b/
engines/e4defrag.c
@@
-9,11
+9,7
@@
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/uio.h>
#include <errno.h>
#include <errno.h>
-#include <assert.h>
#include <fcntl.h>
#include "../fio.h"
#include <fcntl.h>
#include "../fio.h"
@@
-131,7
+127,8
@@
static void fio_e4defrag_cleanup(struct thread_data *td)
}
}
-static int fio_e4defrag_queue(struct thread_data *td, struct io_u *io_u)
+static enum fio_q_status fio_e4defrag_queue(struct thread_data *td,
+ struct io_u *io_u)
{
int ret;
{
int ret;
@@
-172,8
+169,13
@@
static int fio_e4defrag_queue(struct thread_data *td, struct io_u *io_u)
len = io_u->xfer_buflen;
if (len != io_u->xfer_buflen) {
len = io_u->xfer_buflen;
if (len != io_u->xfer_buflen) {
- io_u->resid = io_u->xfer_buflen - len;
- io_u->error = 0;
+ if (len) {
+ io_u->resid = io_u->xfer_buflen - len;
+ io_u->error = 0;
+ } else {
+ /* access beyond i_size */
+ io_u->error = EINVAL;
+ }
}
if (ret)
io_u->error = errno;
}
if (ret)
io_u->error = errno;