document changes to --client syntax and behavior
[fio.git] / iolog.c
diff --git a/iolog.c b/iolog.c
index 7448ecfcc1cfe52729c449d62a80ab85c89e909e..b29684a85eb69c30d219b95eff122c33df9ce5f6 100644 (file)
--- a/iolog.c
+++ b/iolog.c
@@ -291,6 +291,18 @@ void unlog_io_piece(struct thread_data *td, struct io_u *io_u)
 {
        struct io_piece *ipo = io_u->ipo;
 
+       if (td->ts.nr_block_infos) {
+               uint32_t *info = io_u_block_info(td, io_u);
+               if (BLOCK_INFO_STATE(*info) < BLOCK_STATE_TRIM_FAILURE) {
+                       if (io_u->ddir == DDIR_TRIM)
+                               *info = BLOCK_INFO_SET_STATE(*info,
+                                               BLOCK_STATE_TRIM_FAILURE);
+                       else if (io_u->ddir == DDIR_WRITE)
+                               *info = BLOCK_INFO_SET_STATE(*info,
+                                               BLOCK_STATE_WRITE_FAILURE);
+               }
+       }
+
        if (!ipo)
                return;
 
@@ -876,12 +888,12 @@ int iolog_file_inflate(const char *file)
        if (ret < 0) {
                perror("fread");
                fclose(f);
-                free(buf);
+               free(buf);
                return 1;
        } else if (ret != 1) {
                log_err("fio: short read on reading log\n");
                fclose(f);
-                free(buf);
+               free(buf);
                return 1;
        }