Flexible I/O Tester development
 help / color / mirror / Atom feed
* [PATCH] Bail out if glfs_creat failed
@ 2014-07-03 16:22 Tiziano Müller
  2014-07-03 16:48 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Tiziano Müller @ 2014-07-03 16:22 UTC (permalink / raw)
  To: fio; +Cc: Tiziano Müller

Otherwise we will get segfaults from gfapi when it tries to access the
invalid fd.
---
 engines/glusterfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/engines/glusterfs.c b/engines/glusterfs.c
index 94daab5..a64c687 100644
--- a/engines/glusterfs.c
+++ b/engines/glusterfs.c
@@ -160,8 +160,9 @@ int fio_gf_open_file(struct thread_data *td, struct fio_file *f)
 	       flags & O_RDONLY ? "ro" : "rw", td_read(td) ? "read" : "write");
 	g->fd = glfs_creat(g->fs, f->file_name, flags, 0644);
 	if (!g->fd) {
-		log_err("glfs_creat failed.\n");
 		ret = errno;
+		log_err("glfs_creat failed.\n");
+		return ret;
 	}
 	/* file for read doesn't exist or shorter than required, create/extend it */
 	if (td_read(td)) {
-- 
2.0.0


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

end of thread, other threads:[~2014-07-03 16:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-03 16:22 [PATCH] Bail out if glfs_creat failed Tiziano Müller
2014-07-03 16:48 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox