summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-07-31 23:26:54 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-31 23:26:54 +0300
commit5c6207539aea8b22490f9569db5aa72ddfd0d486 (patch)
tree798e72f557db4427878a5969cdcd5cf192047dc4 /fs
parentb36a1552d7319bbfd5cf7f08726c23c5c66d4f73 (diff)
parentc2c44ec20a8496f7a3b3401c092afe96908eced1 (diff)
downloadlinux-5c6207539aea8b22490f9569db5aa72ddfd0d486.tar.xz
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull mount_capable() fix from Al Viro. * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: Unbreak mount_capable()
Diffstat (limited to 'fs')
-rw-r--r--fs/super.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/super.c b/fs/super.c
index 113c58f19425..5960578a4076 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -478,13 +478,10 @@ EXPORT_SYMBOL(generic_shutdown_super);
bool mount_capable(struct fs_context *fc)
{
- struct user_namespace *user_ns = fc->global ? &init_user_ns
- : fc->user_ns;
-
if (!(fc->fs_type->fs_flags & FS_USERNS_MOUNT))
return capable(CAP_SYS_ADMIN);
else
- return ns_capable(user_ns, CAP_SYS_ADMIN);
+ return ns_capable(fc->user_ns, CAP_SYS_ADMIN);
}
/**