From d8c08a1cea6428fa37b3a6585150b10dedfd79b8 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Wed, 18 Mar 2026 09:28:30 +1100 Subject: [PATCH] Linux 7.0: also set setlease handler on directories (#18331) It turns out the kernel can also take directory leases, most notably in the NFS server. Without a setlease handler on the directory file ops, attempts to open a directory over NFS can fail with EINVAL. Adding a directory setlease handler was missed in 168023b603. This fixes that, allowing directories to be properly accessed over NFS. Sponsored-by: TrueNAS Reported-by: Satadru Pramanik Signed-off-by: Rob Norris Reviewed-by: Alexander Motin Reviewed-by: Brian Behlendorf --- module/os/linux/zfs/zpl_file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/module/os/linux/zfs/zpl_file.c b/module/os/linux/zfs/zpl_file.c index 30f3e3855..efcb400f1 100644 --- a/module/os/linux/zfs/zpl_file.c +++ b/module/os/linux/zfs/zpl_file.c @@ -1268,6 +1268,7 @@ const struct file_operations zpl_dir_file_operations = { .read = generic_read_dir, .iterate_shared = zpl_iterate, .fsync = zpl_fsync, + .setlease = generic_setlease, .unlocked_ioctl = zpl_ioctl, #ifdef CONFIG_COMPAT .compat_ioctl = zpl_compat_ioctl,