Differentiate between bool error return and real error value
authorJens Axboe <jens.axboe@oracle.com>
Mon, 19 Feb 2007 09:06:17 +0000 (10:06 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 19 Feb 2007 09:06:17 +0000 (10:06 +0100)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fio.c
io_u.c

diff --git a/fio.c b/fio.c
index 78deaf66a732b6e92434cf0ccef52b66b62d5a71..6e78949b52fd7771b94d31bc0b14c0575e18c84c 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -279,7 +279,8 @@ requeue:
                                io_u->xfer_buf += bytes;
                                goto requeue;
                        }
                                io_u->xfer_buf += bytes;
                                goto requeue;
                        }
-                       if (io_u_sync_complete(td, io_u, verify_io_u))
+                       ret = io_u_sync_complete(td, io_u, verify_io_u);
+                       if (ret)
                                break;
                        continue;
                case FIO_Q_QUEUED:
                                break;
                        continue;
                case FIO_Q_QUEUED:
@@ -290,7 +291,7 @@ requeue:
                        break;
                }
 
                        break;
                }
 
-               if (ret < 0)
+               if (ret < 0 || td->error)
                        break;
 
                /*
                        break;
 
                /*
@@ -397,6 +398,8 @@ requeue:
                        }
                        fio_gettime(&comp_time, NULL);
                        bytes_done = io_u_sync_complete(td, io_u, NULL);
                        }
                        fio_gettime(&comp_time, NULL);
                        bytes_done = io_u_sync_complete(td, io_u, NULL);
+                       if (bytes_done < 0)
+                               ret = bytes_done;
                        break;
                case FIO_Q_QUEUED:
                        break;
                        break;
                case FIO_Q_QUEUED:
                        break;
@@ -406,7 +409,7 @@ requeue:
                        break;
                }
 
                        break;
                }
 
-               if (ret < 0)
+               if (ret < 0 || td->error)
                        break;
 
                add_slat_sample(td, io_u->ddir, mtime_since(&io_u->start_time, &io_u->issue_time));
                        break;
 
                add_slat_sample(td, io_u->ddir, mtime_since(&io_u->start_time, &io_u->issue_time));
diff --git a/io_u.c b/io_u.c
index b0e91e7a1bcc2b52d479df079e671629b8cf3ac8..c04c9de06572f4cbddc476d36f6282eb1913fa80 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -465,7 +465,6 @@ long io_u_sync_complete(struct thread_data *td, struct io_u *io_u,
        if (!icd.error)
                return icd.bytes_done[0] + icd.bytes_done[1];
 
        if (!icd.error)
                return icd.bytes_done[0] + icd.bytes_done[1];
 
-       td_verror(td, icd.error);
        return -1;
 }
 
        return -1;
 }
 
@@ -493,6 +492,5 @@ long io_u_queued_complete(struct thread_data *td, int min_events,
        if (!icd.error)
                return icd.bytes_done[0] + icd.bytes_done[1];
 
        if (!icd.error)
                return icd.bytes_done[0] + icd.bytes_done[1];
 
-       td_verror(td, icd.error);
        return -1;
 }
        return -1;
 }