From cba5243b2e61fb7215706bc6901ed1af0e4666a4 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 21 Mar 2013 10:06:58 -0600 Subject: [PATCH] Only attempt file unlock if we use locking Fixes a segfault on exit, if file locking isn't used. Signed-off-by: Jens Axboe --- ioengines.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ioengines.c b/ioengines.c index 234f8edd..4d1491cf 100644 --- a/ioengines.c +++ b/ioengines.c @@ -475,7 +475,9 @@ int td_io_close_file(struct thread_data *td, struct fio_file *f) fio_file_set_closing(f); disk_util_dec(f->du); - unlock_file_all(td, f); + + if (td->o.file_lock_mode != FILE_LOCK_NONE) + unlock_file_all(td, f); return put_file(td, f); } -- 2.25.1