Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a kill switch for SEEK_HOLE/SEEK_DATA #16000

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion module/os/linux/zfs/zpl_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To not mess with formatting his could be moved into if below. And lets remove extra parentheses.

#if defined(SEEK_HOLE) && defined(SEEK_DATA)
fstrans_cookie_t cookie;

Expand All @@ -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));
}

Expand Down Expand Up @@ -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");
2 changes: 1 addition & 1 deletion module/zfs/zfs_vnops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading