Only set O_RDWR for open() when readonly isn't set

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/filesetup.c b/filesetup.c
index 37a3439..5c02f1c 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -291,9 +291,8 @@
 
 open_again:
 	if (td_write(td)) {
-		assert(!read_only);
-
-		flags |= O_RDWR;
+		if (!read_only)
+			flags |= O_RDWR;
 
 		if (f->filetype == FIO_TYPE_FILE)
 			flags |= O_CREAT;