Skip to content

Commit 2038b72

Browse files
committed
Merge branch 'fix_issue_1642' of https://github.com/zqs-Oppenauer/fio
* 'fix_issue_1642' of https://github.com/zqs-Oppenauer/fio: fix assert failed when timeout during call rate_ddir.
2 parents c5d8ce3 + e8a0b53 commit 2038b72

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

io_ddir.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ enum fio_ddir {
1111
DDIR_WAIT,
1212
DDIR_LAST,
1313
DDIR_INVAL = -1,
14+
DDIR_TIMEOUT = -2,
1415

1516
DDIR_RWDIR_CNT = 3,
1617
DDIR_RWDIR_SYNC_CNT = 4,

io_u.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ static enum fio_ddir rate_ddir(struct thread_data *td, enum fio_ddir ddir)
717717
* check if the usec is capable of taking negative values
718718
*/
719719
if (now > td->o.timeout) {
720-
ddir = DDIR_INVAL;
720+
ddir = DDIR_TIMEOUT;
721721
return ddir;
722722
}
723723
usec = td->o.timeout - now;
@@ -726,7 +726,7 @@ static enum fio_ddir rate_ddir(struct thread_data *td, enum fio_ddir ddir)
726726

727727
now = utime_since_now(&td->epoch);
728728
if ((td->o.timeout && (now > td->o.timeout)) || td->terminate)
729-
ddir = DDIR_INVAL;
729+
ddir = DDIR_TIMEOUT;
730730

731731
return ddir;
732732
}
@@ -951,7 +951,7 @@ static int fill_io_u(struct thread_data *td, struct io_u *io_u)
951951

952952
set_rw_ddir(td, io_u);
953953

954-
if (io_u->ddir == DDIR_INVAL) {
954+
if (io_u->ddir == DDIR_INVAL || io_u->ddir == DDIR_TIMEOUT) {
955955
dprint(FD_IO, "invalid direction received ddir = %d", io_u->ddir);
956956
return 1;
957957
}
@@ -1419,6 +1419,10 @@ static long set_io_u_file(struct thread_data *td, struct io_u *io_u)
14191419
put_file_log(td, f);
14201420
td_io_close_file(td, f);
14211421
io_u->file = NULL;
1422+
1423+
if (io_u->ddir == DDIR_TIMEOUT)
1424+
return 1;
1425+
14221426
if (td->o.file_service_type & __FIO_FSERVICE_NONUNIFORM)
14231427
fio_file_reset(td, f);
14241428
else {

zbd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2171,6 +2171,7 @@ enum io_u_action zbd_adjust_block(struct thread_data *td, struct io_u *io_u)
21712171
case DDIR_WAIT:
21722172
case DDIR_LAST:
21732173
case DDIR_INVAL:
2174+
case DDIR_TIMEOUT:
21742175
goto accept;
21752176
}
21762177

0 commit comments

Comments
 (0)