diff -rupN orig/eta.c new/eta.c
--- orig/eta.c	2008-08-04 12:43:55.000000000 -0700
+++ new/eta.c	2008-09-08 17:26:40.635433000 -0700
@@ -115,6 +115,9 @@ static int thread_eta(struct thread_data
 	if (td->o.zone_size && td->o.zone_skip)
 		bytes_total /= (td->o.zone_skip / td->o.zone_size);
 
+	if (td->o.fill_device && td->o.size  == -1ULL)
+		return 0;
+
 	if (td->runstate == TD_RUNNING || td->runstate == TD_VERIFYING) {
 		double perc, perc_t;
 
@@ -247,8 +250,13 @@ void print_thread_status(void)
 		eta_sec = 0;
 
 	for_each_td(td, i) {
-		if (eta_secs[i] != INT_MAX)
-			eta_sec += eta_secs[i];
+		if (exitall_on_terminate) {
+			if (eta_secs[i] < eta_sec)
+				eta_sec = eta_secs[i];
+		} else {
+			if (eta_secs[i] > eta_sec)
+				eta_sec = eta_secs[i];
+		}
 	}
 
 	free(eta_secs);
diff -rupN orig/filehash.c new/filehash.c
--- orig/filehash.c	2008-08-04 12:43:55.000000000 -0700
+++ new/filehash.c	2008-09-05 15:53:44.297049000 -0700
@@ -39,6 +39,9 @@ static struct fio_file *__lookup_file_ha
 	flist_for_each(n, bucket) {
 		struct fio_file *f = flist_entry(n, struct fio_file, hash_list);
 
+		if (f->file_name == NULL)
+			return NULL;
+
 		if (!strcmp(f->file_name, name)) {
 			assert(f->fd != -1);
 			return f;
diff -rupN orig/filesetup.c new/filesetup.c
--- orig/filesetup.c	2008-08-04 12:43:55.000000000 -0700
+++ new/filesetup.c	2008-09-08 18:05:24.511659000 -0700
@@ -193,6 +193,9 @@ static int __file_invalidate_cache(struc
 {
 	int ret = 0;
 
+	if (td->o.odirect)
+		return 0;
+
 	if (len == -1ULL)
 		len = f->io_size;
 	if (off == -1ULL)
@@ -543,8 +546,10 @@ int setup_files(struct thread_data *td)
 	 */
 	if (need_extend) {
 		temp_stall_ts = 1;
-		log_info("%s: Laying out IO file(s) (%u file(s) / %LuMiB)\n",
-			td->o.name, need_extend, extend_size >> 20);
+		if(!terse_output)
+			log_info("%s: Laying out IO file(s) (%u file(s) / \
+				 %LuMiB)\n", td->o.name, need_extend,
+				 extend_size >> 20);
 
 		for_each_file(td, f, i) {
 			unsigned long long old_len, extend_len;
@@ -647,6 +652,7 @@ void close_and_free_files(struct thread_
 		}
 
 		td_io_close_file(td, f);
+		remove_file_hash(f);
 
 		sfree(f->file_name);
 		f->file_name = NULL;
diff -rupN orig/smalloc.c new/smalloc.c
--- orig/smalloc.c	2008-08-04 12:43:55.000000000 -0700
+++ new/smalloc.c	2008-09-05 15:51:42.941443000 -0700
@@ -226,9 +226,7 @@ static int add_pool(struct pool *pool, u
 
 	pool->fd = fd;
 
-	global_write_lock();
 	nr_pools++;
-	global_write_unlock();
 	return 0;
 out_unlink:
 	fprintf(stderr, "smalloc: failed adding pool\n");
@@ -442,7 +440,7 @@ void *smalloc(unsigned int size)
 {
 	unsigned int i;
 
-	global_read_lock();
+	global_write_lock();
 	i = last_pool;
 
 	do {
@@ -451,7 +449,7 @@ void *smalloc(unsigned int size)
 
 			if (ptr) {
 				last_pool = i;
-				global_read_unlock();
+				global_write_unlock();
 				return ptr;
 			}
 		}
@@ -464,15 +462,13 @@ void *smalloc(unsigned int size)
 			break;
 		else {
 			i = nr_pools;
-			global_read_unlock();
 			if (add_pool(&mp[nr_pools], size))
 				goto out;
-			global_read_lock();
 		}
 	} while (1);
 
-	global_read_unlock();
 out:
+	global_write_unlock();
 	return NULL;
 }

