diff options
author | Jeff Layton <jlayton@kernel.org> | 2021-08-19 20:56:38 +0200 |
---|---|---|
committer | Jeff Layton <jlayton@kernel.org> | 2021-08-23 12:15:36 +0200 |
commit | f7e33bdbd6d1bdf9c3df8bba5abcf3399f957ac3 (patch) | |
tree | 00770e117522b347bb99858aa9069171f0c8b779 /fs/ocfs2/locks.c | |
parent | fcntl: fix potential deadlock for &fasync_struct.fa_lock (diff) | |
download | linux-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/ocfs2/locks.c')
-rw-r--r-- | fs/ocfs2/locks.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/ocfs2/locks.c b/fs/ocfs2/locks.c index fab7c6a4a7d0..73a3854b2afb 100644 --- a/fs/ocfs2/locks.c +++ b/fs/ocfs2/locks.c @@ -101,8 +101,6 @@ int ocfs2_flock(struct file *file, int cmd, struct file_lock *fl) if (!(fl->fl_flags & FL_FLOCK)) return -ENOLCK; - if (__mandatory_lock(inode)) - return -ENOLCK; if ((osb->s_mount_opt & OCFS2_MOUNT_LOCALFLOCKS) || ocfs2_mount_local(osb)) @@ -121,8 +119,6 @@ int ocfs2_lock(struct file *file, int cmd, struct file_lock *fl) if (!(fl->fl_flags & FL_POSIX)) return -ENOLCK; - if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK) - return -ENOLCK; return ocfs2_plock(osb->cconn, OCFS2_I(inode)->ip_blkno, file, cmd, fl); } |