[PATCH] Remember to check ioops version in loaded module
authorJens Axboe <jens.axboe@oracle.com>
Mon, 9 Oct 2006 14:11:45 +0000 (16:11 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 9 Oct 2006 14:11:45 +0000 (16:11 +0200)
It could be for an older version of fio, reject failed version.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
ioengines.c

index 658b2eb..1790963 100644 (file)
@@ -46,6 +46,12 @@ struct ioengine_ops *load_ioengine(struct thread_data *td, char *name)
                return NULL;
        }
 
+       if (ops->version != FIO_IOOPS_VERSION) {
+               log_err("bad ioops version %d (want %d)\n", ops->version, FIO_IOOPS_VERSION);
+               dlclose(dlhandle);
+               return NULL;
+       }
+
        ops->dlhandle = dlhandle;
        return ops;
 }