Only attempt file unlock if we use locking
authorJens Axboe <axboe@kernel.dk>
Thu, 21 Mar 2013 16:06:58 +0000 (10:06 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 21 Mar 2013 16:06:58 +0000 (10:06 -0600)
Fixes a segfault on exit, if file locking isn't used.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
ioengines.c

index 234f8edd13251ab07e7f7b431d3d90279c4c9b9a..4d1491cf079b5a504a22aad46965ade8c95bc6c8 100644 (file)
@@ -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);
 }