aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-09-18 13:41:01 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2019-09-18 13:41:01 -0700
commitd013cc800a2a41b0496f99a11f3cff724cf65941 (patch)
tree43dfaac956d04461b8fcf24e7d4cf2582beb68b7 /fs/namespace.c
parentMerge branch 'work.mount-base' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs (diff)
parentlocks: fix a memory leak bug in __break_lease() (diff)
downloadwireguard-linux-d013cc800a2a41b0496f99a11f3cff724cf65941.tar.xz
wireguard-linux-d013cc800a2a41b0496f99a11f3cff724cf65941.zip
Merge tag 'filelock-v5.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux
Pull file locking updates from Jeff Layton: "Just a couple of minor bugfixes, a revision to a tracepoint to account for some earlier changes to the internals, and a patch to add a pr_warn message when someone tries to mount a filesystem with '-o mand' on a kernel that has that support disabled" * tag 'filelock-v5.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux: locks: fix a memory leak bug in __break_lease() locks: print a warning when mount fails due to lack of "mand" support locks: Fix procfs output for file leases locks: revise generic_add_lease tracepoint
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 81edb7e7ddfd..227f7b343034 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1643,13 +1643,18 @@ static inline bool may_mount(void)
return ns_capable(current->nsproxy->mnt_ns->user_ns, CAP_SYS_ADMIN);
}
+#ifdef CONFIG_MANDATORY_FILE_LOCKING
static inline bool may_mandlock(void)
{
-#ifndef CONFIG_MANDATORY_FILE_LOCKING
- return false;
-#endif
return capable(CAP_SYS_ADMIN);
}
+#else
+static inline bool may_mandlock(void)
+{
+ pr_warn("VFS: \"mand\" mount option not supported");
+ return false;
+}
+#endif
/*
* Now umount can handle mount points as well as block devices.