From b07b31d44ffee44c9044cdebedf1d42a35c82929 Mon Sep 17 00:00:00 2001 From: Shaun Tancheff Date: Sat, 10 Aug 2024 09:12:21 +0700 Subject: [PATCH] LU-17525 llite: unaligned DIO zfs detection Update to the ZFS detection logic to be stable. If any component of the I/O is ZFS treat the entire I/O as ZFS HPE-bug-id: LUS-12175 Fixes: 07a1272233 ("LU-17525 llite: unaligned DIO interop page alignment") Signed-off-by: Shaun Tancheff Change-Id: Ie9d5c8af373cec96855f81f5330e174ed71f370a Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55895 Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- lustre/llite/file.c | 1 + lustre/osc/osc_io.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 14d4815..8abd025 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -1699,6 +1699,7 @@ void ll_io_init(struct cl_io *io, struct file *file, enum cl_io_type iot, * avaliable mirror for write. */ io->ci_ndelay = !(iot == CIT_WRITE); + io->ci_target_is_zfs = 0; /* unaligned DIO has compat issues with some older servers, but we find * out if there are such servers while setting up the IO, so it starts * out allowed diff --git a/lustre/osc/osc_io.c b/lustre/osc/osc_io.c index 296213f..b28ad18 100644 --- a/lustre/osc/osc_io.c +++ b/lustre/osc/osc_io.c @@ -1351,7 +1351,8 @@ int osc_io_init(const struct lu_env *env, CL_IO_SLICE_CLEAN(oio, oi_cl); cl_io_slice_add(io, &oio->oi_cl, obj, &osc_io_ops); - cl_io_top(io)->ci_target_is_zfs = exp_connect_target_is_zfs(exp); + if (exp_connect_target_is_zfs(exp)) + cl_io_top(io)->ci_target_is_zfs = 1; if (!exp_connect_unaligned_dio(exp)) cl_io_top(io)->ci_allow_unaligned_dio = false; -- 1.8.3.1