nvme/fio_plugin: spdk_fio_get_zoned_model() is too permissive

The .get_zoned_model() callback is supposed to reject unsupported
file types. Right now, we only reject FIO_TYPE_PIPE.

However, in attach_cb() our ioengine unconditionally initializes
f->filetype to FIO_TYPE_BLOCK. This means that the only file type
that our ioengine supports is FIO_TYPE_BLOCK.

Therefore, fix spdk_get_zoned_model() to reject everything that
we do not support.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I115bb8ff9c8ea9f647baebc0196900681a36c410
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8327
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Niklas Cassel 2021-06-07 10:33:41 +00:00 committed by Tomasz Zawadzki
parent bd53d09c31
commit 5172337d95

View File

@ -1153,9 +1153,7 @@ spdk_fio_get_zoned_model(struct thread_data *td, struct fio_file *f, enum zbd_zo
struct spdk_fio_qpair *fio_qpair = NULL;
const struct spdk_nvme_zns_ns_data *zns_data = NULL;
if (f->filetype != FIO_TYPE_FILE && \
f->filetype != FIO_TYPE_BLOCK && \
f->filetype != FIO_TYPE_CHAR) {
if (f->filetype != FIO_TYPE_BLOCK) {
log_info("spdk/nvme: unsupported filetype: %d\n", f->filetype);
return -EINVAL;
}