From c642e985e596eb38d9ea9be2bc97ff0fd9c7d5a0 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Sat, 12 Oct 2024 13:51:35 -0700 Subject: [PATCH] Revert "Temporarily disable Direct IO by default" This partially reverts commit 41210597. Now that b4e4cbeb2 has been merged Direct IO can be enabled by default for Linux, but for FreeBSD there still remains a potentially insufficient range locking in zfs_getpages() which needs to be resolved. Reviewed-by: Tony Hutter Signed-off-by: Brian Behlendorf Closes #16629 --- module/zfs/zfs_vnops.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c index d5e0d2a2b..0799f1775 100644 --- a/module/zfs/zfs_vnops.c +++ b/module/zfs/zfs_vnops.c @@ -77,8 +77,15 @@ static int zfs_bclone_wait_dirty = 0; * Enable Direct I/O. If this setting is 0, then all I/O requests will be * directed through the ARC acting as though the dataset property direct was * set to disabled. + * + * Disabled by default on FreeBSD until a potential range locking issue in + * zfs_getpages() can be resolved. */ +#ifdef __FreeBSD__ static int zfs_dio_enabled = 0; +#else +static int zfs_dio_enabled = 1; +#endif /*