From 02e4699d911e41feec06a9f0a9059b7bf4e6b28b Mon Sep 17 00:00:00 2001 From: Rich Ercolani Date: Sun, 17 Mar 2024 14:03:12 -0400 Subject: [PATCH 1/2] Added Linux-specific hole fallback tunable Per #15933, there's currently an inconsistency in behavior in our special-case SEEK_HOLE behavior. So let's not use it for now. Signed-off-by: Rich Ercolani --- module/os/linux/zfs/zpl_file.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/module/os/linux/zfs/zpl_file.c b/module/os/linux/zfs/zpl_file.c index 3caa0fc6c214..567ba34841e0 100644 --- a/module/os/linux/zfs/zpl_file.c +++ b/module/os/linux/zfs/zpl_file.c @@ -51,6 +51,8 @@ */ static unsigned int zfs_fallocate_reserve_percent = 110; +static unsigned int zfs_disable_holey = 1; + static int zpl_open(struct inode *ip, struct file *filp) { @@ -550,6 +552,7 @@ zpl_direct_IO(int rw, struct kiocb *kiocb, struct iov_iter *iter, loff_t pos) static loff_t zpl_llseek(struct file *filp, loff_t offset, int whence) { +if (!(zfs_disable_holey)) { #if defined(SEEK_HOLE) && defined(SEEK_DATA) fstrans_cookie_t cookie; @@ -569,7 +572,7 @@ zpl_llseek(struct file *filp, loff_t offset, int whence) return (error); } #endif /* SEEK_HOLE && SEEK_DATA */ - +} return (generic_file_llseek(filp, offset, whence)); } @@ -1389,3 +1392,8 @@ const struct file_operations zpl_dir_file_operations = { module_param(zfs_fallocate_reserve_percent, uint, 0644); MODULE_PARM_DESC(zfs_fallocate_reserve_percent, "Percentage of length to use for the available capacity check"); + +/* CSTYLED */ +module_param(zfs_disable_holey, uint, 0644); +MODULE_PARM_DESC(zfs_disable_holey, + "Disable ZFS-specific implementation of hole detection"); From 35c7b43e9f626e4525e6443d47aadb9cf5a48632 Mon Sep 17 00:00:00 2001 From: Rich Ercolani Date: Sun, 17 Mar 2024 14:07:04 -0400 Subject: [PATCH 2/2] Disable bclone_enabled by default until #15933 is resolved Signed-off-by: Rich Ercolani --- module/zfs/zfs_vnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c index 7f39ad6fc775..ee476ef5d2db 100644 --- a/module/zfs/zfs_vnops.c +++ b/module/zfs/zfs_vnops.c @@ -63,7 +63,7 @@ * even if feature@block_cloning is enabled, attempts to clone blocks will act * as though the feature is disabled. */ -int zfs_bclone_enabled = 1; +int zfs_bclone_enabled = 0; /* * When set zfs_clone_range() waits for dirty data to be written to disk.