summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2021-08-19 14:56:38 -0400
committerJeff Layton <jlayton@kernel.org>2021-08-23 06:15:36 -0400
commitf7e33bdbd6d1bdf9c3df8bba5abcf3399f957ac3 (patch)
tree00770e117522b347bb99858aa9069171f0c8b779 /fs/namei.c
parent2f488f698fda820f8e6fa0407630154eceb145d6 (diff)
downloadlinux-f7e33bdbd6d1bdf9c3df8bba5abcf3399f957ac3.tar.gz
linux-f7e33bdbd6d1bdf9c3df8bba5abcf3399f957ac3.tar.bz2
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/namei.c')
-rw-r--r--fs/namei.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/namei.c b/fs/namei.c
index bf6d8a738c59..471eb9fead6e 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3023,9 +3023,7 @@ static int handle_truncate(struct user_namespace *mnt_userns, struct file *filp)
/*
* Refuse to truncate files with mandatory locks held on them.
*/
- error = locks_verify_locked(filp);
- if (!error)
- error = security_path_truncate(path);
+ error = security_path_truncate(path);
if (!error) {
error = do_truncate(mnt_userns, path->dentry, 0,
ATTR_MTIME|ATTR_CTIME|ATTR_OPEN,