Recent changes (master)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following changes since commit 0de5b26f6e177aacac0683306c47e0cbaf58b0b6:

  Unify the time handling (2014-02-21 15:26:01 -0800)

are available in the git repository at:

  git://git.kernel.dk/fio.git master

for you to fetch changes up to bcd27f7ae1ccebd2ac1778752bf8f13fa99600e9:

  Fixup ->open_files if not given (2014-02-25 14:01:26 -0800)

----------------------------------------------------------------
Jens Axboe (4):
      Ensure that fio_get_kb_base() doesn't assume 'data' is thread_options
      Fix crash with --debug=file and NULL file return
      net: fix accidental overwrite of more than just the address
      Fixup ->open_files if not given

 engines/net.c    |    4 ++--
 filesetup.c      |    7 +++++++
 io_u.c           |    5 ++++-
 options.c        |   12 +++++++++++-
 thread_options.h |    4 +++-
 5 files changed, 27 insertions(+), 5 deletions(-)

---

Diff of recent changes:

diff --git a/engines/net.c b/engines/net.c
index 8b85a88..dd06861 100644
--- a/engines/net.c
+++ b/engines/net.c
@@ -913,10 +913,10 @@ static int fio_netio_setup_connect_inet(struct thread_data *td,
 
 	if (is_ipv6(o)) {
 		af = AF_INET6;
-		dst = &nd->addr6;
+		dst = &nd->addr6.sin6_addr;
 	} else {
 		af = AF_INET;
-		dst = &nd->addr;
+		dst = &nd->addr.sin_addr;
 	}
 
 	if (fio_fill_addr(td, host, af, dst, &res))
diff --git a/filesetup.c b/filesetup.c
index f0e3b34..7669d70 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -1230,6 +1230,13 @@ int add_file(struct thread_data *td, const char *fname, int numjob)
 
 	set_already_allocated(file_name);
 
+	/*
+	 * For adding files after the fact - if openfiles= isn't
+	 * given as an option, ensure we allow at least one file open
+	 */
+	if (!td->o.open_files)
+		td->o.open_files = 1;
+
 	dprint(FD_FILE, "file %p \"%s\" added at %d\n", f, f->file_name,
 							cur_files);
 
diff --git a/io_u.c b/io_u.c
index 619fa25..a69efb7 100644
--- a/io_u.c
+++ b/io_u.c
@@ -1093,7 +1093,10 @@ static struct fio_file *__get_next_file(struct thread_data *td)
 	td->file_service_file = f;
 	td->file_service_left = td->file_service_nr - 1;
 out:
-	dprint(FD_FILE, "get_next_file: %p [%s]\n", f, f->file_name);
+	if (f)
+		dprint(FD_FILE, "get_next_file: %p [%s]\n", f, f->file_name);
+	else
+		dprint(FD_FILE, "get_next_file: NULL\n");
 	return f;
 }
 
diff --git a/options.c b/options.c
index 5355982..625d3a2 100644
--- a/options.c
+++ b/options.c
@@ -3790,6 +3790,7 @@ int fio_cmd_ioengine_option_parse(struct thread_data *td, const char *opt,
 
 void fio_fill_default_options(struct thread_data *td)
 {
+	td->o.magic = OPT_MAGIC;
 	fill_default_options(td, fio_options);
 }
 
@@ -3834,7 +3835,16 @@ unsigned int fio_get_kb_base(void *data)
 	struct thread_options *o = data;
 	unsigned int kb_base = 0;
 
-	if (o)
+	/*
+	 * This is a hack... For private options, *data is not holding
+	 * a pointer to the thread_options, but to private data. This means
+	 * we can't safely dereference it, but magic is first so mem wise
+	 * it is valid. But this also means that if the job first sets
+	 * kb_base and expects that to be honored by private options,
+	 * it will be disappointed. We will return the global default
+	 * for this.
+	 */
+	if (o && o->magic == OPT_MAGIC)
 		kb_base = o->kb_base;
 	if (!kb_base)
 		kb_base = 1024;
diff --git a/thread_options.h b/thread_options.h
index b7a88ed..14a4e54 100644
--- a/thread_options.h
+++ b/thread_options.h
@@ -28,8 +28,10 @@ struct bssplit {
 	uint32_t perc;
 };
 
+#define OPT_MAGIC	0x4f50544e
+
 struct thread_options {
-	int pad;
+	int magic;
 	char *description;
 	char *name;
 	char *directory;
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux