Merge tag 'filelock-v5.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton...
[linux-2.6-block.git] / fs / namespace.c
index 81edb7e7ddfda8840e233fd2ead048b3d35377d0..227f7b34303465a2621497524dece91038267b23 100644 (file)
@@ -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.