docs: update cmdprio_percentage with note about root user
[fio.git] / iolog.c
diff --git a/iolog.c b/iolog.c
index 2f062892863cb9aa586baa9875fa06dfe30ba0cb..917a446cbc5e811356d9197543cb7940088c9409 100644 (file)
--- a/iolog.c
+++ b/iolog.c
@@ -634,18 +634,18 @@ static bool init_iolog_read(struct thread_data *td)
                return false;
        }
 
-       td->io_log_rfile = f;
-
        /*
         * version 2 of the iolog stores a specific string as the
         * first line, check for that
         */
        if (!strncmp(iolog_ver2, buffer, strlen(iolog_ver2))) {
                free_release_files(td);
+               td->io_log_rfile = f;
                return read_iolog2(td);
        }
 
        log_err("fio: iolog version 1 is no longer supported\n");
+       fclose(f);
        return false;
 }
 
@@ -896,18 +896,18 @@ void flush_samples(FILE *f, void *samples, uint64_t sample_size)
                s = __get_sample(samples, log_offset, i);
 
                if (!log_offset) {
-                       fprintf(f, "%lu, %" PRId64 ", %u, %llu\n",
+                       fprintf(f, "%lu, %" PRId64 ", %u, %llu, %u\n",
                                        (unsigned long) s->time,
                                        s->data.val,
-                                       io_sample_ddir(s), (unsigned long long) s->bs);
+                                       io_sample_ddir(s), (unsigned long long) s->bs, s->priority_bit);
                } else {
                        struct io_sample_offset *so = (void *) s;
 
-                       fprintf(f, "%lu, %" PRId64 ", %u, %llu, %llu\n",
+                       fprintf(f, "%lu, %" PRId64 ", %u, %llu, %llu, %u\n",
                                        (unsigned long) s->time,
                                        s->data.val,
                                        io_sample_ddir(s), (unsigned long long) s->bs,
-                                       (unsigned long long) so->offset);
+                                       (unsigned long long) so->offset, s->priority_bit);
                }
        }
 }