From: Jens Axboe Date: Thu, 21 Mar 2013 16:06:58 +0000 (-0600) Subject: Only attempt file unlock if we use locking X-Git-Tag: fio-2.0.15~18 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=cba5243b2e61fb7215706bc6901ed1af0e4666a4;p=fio.git Only attempt file unlock if we use locking Fixes a segfault on exit, if file locking isn't used. Signed-off-by: Jens Axboe --- 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); }