[PATCH] Unlink write file if !overwrite and it exists

Repeatability across runs, unlink the file so that the job
runs like it wasn't there to begin with.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/filesetup.c b/filesetup.c
index 7528870..2af6c2f 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -103,9 +103,18 @@
 		return 0;
 
 	need_create = 0;
-	if (td->filetype == FIO_TYPE_FILE)
-		for_each_file(td, f, i)
-			need_create += file_ok(td, f);
+	if (td->filetype == FIO_TYPE_FILE) {
+		for_each_file(td, f, i) {
+			int file_there = !file_ok(td, f);
+
+			if (file_there && td->ddir == WRITE && !td->overwrite) {
+				unlink(f->file_name);
+				file_there = 0;
+			}
+
+			need_create += !file_there;
+		}
+	}
 
 	if (!need_create)
 		return 0;