glusterfs: always allocate io_u->engine_data
authorsimon <simon29rock@gmail.com>
Tue, 3 Apr 2018 12:16:36 +0000 (20:16 +0800)
committersimon <simon29rock@gmail.com>
Tue, 3 Apr 2018 12:16:36 +0000 (20:16 +0800)
commit04e9eb82e88368f930d0fb8970c2b3e30ffd4321
tree8388130690273552904ba25c3b6e119d9bea12b4
parentcefd2a94b408b9c3be0300edb1270a546e7f09fe
glusterfs: always allocate io_u->engine_data

When the iodepth is greater then 1 some io_us in fio_gf_io_u_init() can
be fooled into thinking their .engine_data has already been set when it
hasn't. This happens because .index and .engine_data are part of the
same union and .index can be set to non-zero values:

static int init_io_u(struct thread_data *td)
...
        for (i = 0; i < max_units; i++) {
            ...
            io_u->index = i;
            ...
            if (td->io_ops->io_u_init) {
                int ret = td->io_ops->io_u_init(td, io_u);

which means io_u->engine_data != 0 in fio_gf_io_u_init().

Fix the issue by removing the initial check of io_u->engine_data.

Signed-off-by: Simon Gao <simon29rock@gmail.com>
engines/glusterfs_async.c