zbd: disallow pipes for zonemode=zbd
authorNiklas Cassel <niklas.cassel@wdc.com>
Mon, 14 Jun 2021 13:49:03 +0000 (13:49 +0000)
committerJens Axboe <axboe@kernel.dk>
Mon, 14 Jun 2021 14:54:25 +0000 (08:54 -0600)
zoned block device support in fio cannot handle pipes,
so simply reject them and give a clear error message.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
zbd.c

diff --git a/zbd.c b/zbd.c
index 5d9e331ac9347f8e2af3441f4e3a519550b95602..60325d28fa6f4c3cfba577b3c9f7d17b7862abae 100644 (file)
--- a/zbd.c
+++ b/zbd.c
@@ -32,6 +32,11 @@ int zbd_get_zoned_model(struct thread_data *td, struct fio_file *f,
 {
        int ret;
 
+       if (f->filetype == FIO_TYPE_PIPE) {
+               log_err("zonemode=zbd does not support pipes\n");
+               return -EINVAL;
+       }
+
        if (td->io_ops && td->io_ops->get_zoned_model)
                ret = td->io_ops->get_zoned_model(td, f, model);
        else