diff options
author | Ankit Kumar <ankit.kumar@samsung.com> | 2022-05-31 19:01:53 +0530 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-06-02 02:19:41 -0600 |
commit | 59c3200d579004d1d9c2dd3a36c162c780d520e4 (patch) | |
tree | e4e038d1e7a8a35b7d1960578fd9533fa64c69ec /zbd.c | |
parent | 3716f9f1bf6db8d4f6500d756912d5ac8cf0a670 (diff) | |
download | fio-59c3200d579004d1d9c2dd3a36c162c780d520e4.tar.gz fio-59c3200d579004d1d9c2dd3a36c162c780d520e4.tar.bz2 |
zbd: Check for direct flag only if its block device
nvme-ns generic character devices currently do not support O_DIRECT flag.
Check for fio option for direct flag only if filetype is a block device.
t/zbd skip test case #1 for character devices as they don't require
direct I/O.
Tested-by: Vincent Fu <vincent.fu@samsung.com>
Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Reviewed-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20220531133155.17493-8-ankit.kumar@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'zbd.c')
-rw-r--r-- | zbd.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -466,7 +466,7 @@ out: return res; } -/* Verify whether direct I/O is used for all host-managed zoned drives. */ +/* Verify whether direct I/O is used for all host-managed zoned block drives. */ static bool zbd_using_direct_io(void) { struct thread_data *td; @@ -477,7 +477,7 @@ static bool zbd_using_direct_io(void) if (td->o.odirect || !(td->o.td_ddir & TD_DDIR_WRITE)) continue; for_each_file(td, f, j) { - if (f->zbd_info && + if (f->zbd_info && f->filetype == FIO_TYPE_BLOCK && f->zbd_info->model == ZBD_HOST_MANAGED) return false; } |