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 <satadru@gmail.com>

Signed-off-by: Rob Norris <rob.norris@truenas.com>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
Rob Norris 2026-03-18 09:28:30 +11:00 committed by GitHub
parent 4655bdd8ab
commit d8c08a1cea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,