All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/13] Fix return value of make_filename() when no filename_format
@ 2017-03-28 20:02 kusumi.tomohiro
  2017-03-28 20:02 ` [PATCH 02/13] Use GOLDEN_RATIO_PRIME kusumi.tomohiro
                   ` (12 more replies)
  0 siblings, 13 replies; 17+ messages in thread
From: kusumi.tomohiro @ 2017-03-28 20:02 UTC (permalink / raw)
  To: axboe, fio; +Cc: Tomohiro Kusumi

From: Tomohiro Kusumi <tkusumi@tuxera.com>

This is unlikely to happen in the first place since ->filename_format
has a default value, and option parser can also detect an empty string,
but it should return buf which is sprintf'd right before returning.

A caller expects this function to return filename string (which is
buf arg itself in this case), and it also doesn't handle NULL return.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
---
 init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/init.c b/init.c
index 4a72255..6af6c45 100644
--- a/init.c
+++ b/init.c
@@ -1121,7 +1121,7 @@ static char *make_filename(char *buf, size_t buf_size,struct thread_options *o,
 
 	if (!o->filename_format || !strlen(o->filename_format)) {
 		sprintf(buf, "%s.%d.%d", jobname, jobnum, filenum);
-		return NULL;
+		return buf;
 	}
 
 	for (f = &fpre_keywords[0]; f->keyword; f++)
-- 
2.9.3



^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2017-03-28 21:19 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-28 20:02 [PATCH 01/13] Fix return value of make_filename() when no filename_format kusumi.tomohiro
2017-03-28 20:02 ` [PATCH 02/13] Use GOLDEN_RATIO_PRIME kusumi.tomohiro
2017-03-28 20:44   ` Jens Axboe
2017-03-28 21:17     ` Tomohiro Kusumi
2017-03-28 21:19       ` Jens Axboe
2017-03-28 20:02 ` [PATCH 03/13] Test malloc result when allocation size is tunable kusumi.tomohiro
2017-03-28 20:02 ` [PATCH 04/13] Don't malloc more than necessary on extending/prereading file kusumi.tomohiro
2017-03-28 20:02 ` [PATCH 05/13] HOWTO: Mention niche detail of range format options kusumi.tomohiro
2017-03-28 20:02 ` [PATCH 06/13] Drop redundant "ignore invalidate option" message from 21c1b29e kusumi.tomohiro
2017-03-28 20:02 ` [PATCH 07/13] Ignore pre-read for FIO_NOIO td kusumi.tomohiro
2017-03-28 20:02 ` [PATCH 08/13] Don't proceed with error set when failed to pre-read files/devices kusumi.tomohiro
2017-03-28 20:02 ` [PATCH 09/13] Ignore pre-read for character devices kusumi.tomohiro
2017-03-28 20:02 ` [PATCH 10/13] Drop prototype of unused function td_io_sync() kusumi.tomohiro
2017-03-28 20:02 ` [PATCH 11/13] Separate io_u from ioengine [1/3] - add io_u.h kusumi.tomohiro
2017-03-28 20:03 ` [PATCH 12/13] Separate io_u from ioengine [2/3] - move io_u functions kusumi.tomohiro
2017-03-28 20:03 ` [PATCH 13/13] Separate io_u from ioengine [3/3] - rename ioengine.h to ioengines.h kusumi.tomohiro
2017-03-28 21:14 ` [PATCH 01/13] Fix return value of make_filename() when no filename_format Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.