linux/Documentation/filesystems
Jeff Layton 12965a190e
filelock: allow lease_managers to dictate what qualifies as a conflict
Requesting a delegation on a file from the userland fcntl() interface
currently succeeds when there are conflicting opens present.

This is because the lease handling code ignores conflicting opens for
FL_LAYOUT and FL_DELEG leases. This was a hack put in place long ago,
because nfsd already checks for conflicts in its own way. The kernel
needs to perform this check for userland delegations the same way it is
done for leases, however.

Make this dependent on the lease_manager by adding a new
->lm_open_conflict() lease_manager operation and have
generic_add_lease() call that instead of check_conflicting_open().
Morph check_conflicting_open() into a ->lm_open_conflict() op that is
only called for userland leases/delegations. Set the
->lm_open_conflict() operations for nfsd to trivial functions that
always return 0.

Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20251204-dir-deleg-ro-v2-2-22d37f92ce2c@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-12-15 15:20:33 +01:00
..
caching
ext4
fuse
gfs2
iomap
nfs
smb
spufs
xfs
9p.rst
adfs.rst
affs.rst
afs.rst
api-summary.rst
autofs-mount-control.rst
autofs.rst
automount-support.rst
befs.rst
bfs.rst
btrfs.rst
buffer.rst
ceph.rst
coda.rst
configfs.rst
cramfs.rst
dax.rst
debugfs.rst
devpts.rst
directory-locking.rst
dlmfs.rst
dnotify.rst
ecryptfs.rst
efivarfs.rst
erofs.rst
ext2.rst
ext3.rst
f2fs.rst
fiemap.rst
files.rst
fscrypt.rst
fsverity.rst
hfs.rst
hfsplus.rst
hpfs.rst
idmappings.rst
index.rst
inotify.rst
isofs.rst
journalling.rst
locking.rst
locks.rst
mount_api.rst
multigrain-ts.rst
netfs_library.rst
nilfs2.rst
ntfs3.rst
ocfs2-online-filecheck.rst
ocfs2.rst
omfs.rst
orangefs.rst
overlayfs.rst
path-lookup.rst
path-lookup.txt
porting.rst
proc.rst
propagate_umount.txt
qnx6.rst
quota.rst
ramfs-rootfs-initramfs.rst
relay.rst
resctrl.rst
romfs.rst
seq_file.rst
sharedsubtree.rst
splice.rst
squashfs.rst
sysfs.rst
tmpfs.rst
ubifs-authentication.rst
ubifs.rst
udf.rst
vfat.rst
vfs.rst
virtiofs.rst
zonefs.rst