From 5172337d954511ad2d9edd39a53f8c9a56aa21b3 Mon Sep 17 00:00:00 2001 From: Niklas Cassel Date: Mon, 7 Jun 2021 10:33:41 +0000 Subject: [PATCH] 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 Change-Id: I115bb8ff9c8ea9f647baebc0196900681a36c410 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8327 Community-CI: Mellanox Build Bot Reviewed-by: Jim Harris Reviewed-by: Paul Luse Reviewed-by: Changpeng Liu Tested-by: SPDK CI Jenkins --- examples/nvme/fio_plugin/fio_plugin.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/nvme/fio_plugin/fio_plugin.c b/examples/nvme/fio_plugin/fio_plugin.c index 3a2dd24a9..4d590c6a3 100644 --- a/examples/nvme/fio_plugin/fio_plugin.c +++ b/examples/nvme/fio_plugin/fio_plugin.c @@ -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; }