projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix crash: free of wrong pointer in bssplit_ddir
[fio.git]
/
iolog.c
diff --git
a/iolog.c
b/iolog.c
index 4818cd4593b2e0c9d000f7d001b86cf2ee416e17..9bcf0d8e2982e37ce5d48fbd64e9653872e54ea0 100644
(file)
--- a/
iolog.c
+++ b/
iolog.c
@@
-110,7
+110,7
@@
int read_iolog_get(struct thread_data *td, struct io_u *io_u)
{
struct io_piece *ipo;
unsigned long elapsed;
{
struct io_piece *ipo;
unsigned long elapsed;
-
+
while (!flist_empty(&td->io_log_list)) {
int ret;
while (!flist_empty(&td->io_log_list)) {
int ret;
@@
-141,11
+141,10
@@
int read_iolog_get(struct thread_data *td, struct io_u *io_u)
elapsed = mtime_since_genesis();
if (ipo->delay > elapsed)
usec_sleep(td, (ipo->delay - elapsed) * 1000);
elapsed = mtime_since_genesis();
if (ipo->delay > elapsed)
usec_sleep(td, (ipo->delay - elapsed) * 1000);
-
}
free(ipo);
}
free(ipo);
-
+
if (io_u->ddir != DDIR_WAIT)
return 0;
}
if (io_u->ddir != DDIR_WAIT)
return 0;
}
@@
-239,7
+238,9
@@
restart:
else if (ipo->offset > __ipo->offset)
p = &(*p)->rb_right;
else {
else if (ipo->offset > __ipo->offset)
p = &(*p)->rb_right;
else {
- assert(ipo->len == __ipo->len);
+ dprint(FD_IO, "iolog: overlap %llu/%lu, %llu/%lu",
+ __ipo->offset, __ipo->len,
+ ipo->offset, ipo->len);
td->io_hist_len--;
rb_erase(parent, &td->io_hist_tree);
remove_trim_entry(td, __ipo);
td->io_hist_len--;
rb_erase(parent, &td->io_hist_tree);
remove_trim_entry(td, __ipo);
@@
-314,6
+315,7
@@
static int read_iolog2(struct thread_data *td, FILE *f)
act);
continue;
}
act);
continue;
}
+ fileno = get_fileno(td, fname);
} else if (r == 2) {
rw = DDIR_INVAL;
if (!strcmp(act, "add")) {
} else if (r == 2) {
rw = DDIR_INVAL;
if (!strcmp(act, "add")) {
@@
-370,7
+372,7
@@
static int read_iolog2(struct thread_data *td, FILE *f)
ipo->fileno = fileno;
ipo->file_action = file_action;
}
ipo->fileno = fileno;
ipo->file_action = file_action;
}
-
+
queue_io_piece(td, ipo);
}
queue_io_piece(td, ipo);
}
@@
-533,7
+535,7
@@
void finish_log_named(struct thread_data *td, struct io_log *log,
{
char file_name[256], *p;
{
char file_name[256], *p;
- snprintf(file_name,
200
, "%s_%s.log", prefix, postfix);
+ snprintf(file_name,
sizeof(file_name)
, "%s_%s.log", prefix, postfix);
p = basename(file_name);
if (td->client_type == FIO_CLIENT_TYPE_GUI) {
p = basename(file_name);
if (td->client_type == FIO_CLIENT_TYPE_GUI) {