summaryrefslogtreecommitdiffstats
path: root/fs/nfs/file.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2021-08-19 20:56:38 +0200
committerJeff Layton <jlayton@kernel.org>2021-08-23 12:15:36 +0200
commitf7e33bdbd6d1bdf9c3df8bba5abcf3399f957ac3 (patch)
tree00770e117522b347bb99858aa9069171f0c8b779 /fs/nfs/file.c
parentfcntl: fix potential deadlock for &fasync_struct.fa_lock (diff)
downloadlinux-f7e33bdbd6d1bdf9c3df8bba5abcf3399f957ac3.tar.xz
linux-f7e33bdbd6d1bdf9c3df8bba5abcf3399f957ac3.zip
fs: remove mandatory file locking support
We added CONFIG_MANDATORY_FILE_LOCKING in 2015, and soon after turned it off in Fedora and RHEL8. Several other distros have followed suit. I've heard of one problem in all that time: Someone migrated from an older distro that supported "-o mand" to one that didn't, and the host had a fstab entry with "mand" in it which broke on reboot. They didn't actually _use_ mandatory locking so they just removed the mount option and moved on. This patch rips out mandatory locking support wholesale from the kernel, along with the Kconfig option and the Documentation file. It also changes the mount code to ignore the "mand" mount option instead of erroring out, and to throw a big, ugly warning. Signed-off-by: Jeff Layton <jlayton@kernel.org>
Diffstat (limited to 'fs/nfs/file.c')
-rw-r--r--fs/nfs/file.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 1fef107961bc..514be5d28d70 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -806,10 +806,6 @@ int nfs_lock(struct file *filp, int cmd, struct file_lock *fl)
nfs_inc_stats(inode, NFSIOS_VFSLOCK);
- /* No mandatory locks over NFS */
- if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK)
- goto out_err;
-
if (NFS_SERVER(inode)->flags & NFS_MOUNT_LOCAL_FCNTL)
is_local = 1;