Skip to content

Commit 5c62075

Browse files
committed
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()
2 parents b36a155 + c2c44ec commit 5c62075

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

fs/super.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,13 +478,10 @@ EXPORT_SYMBOL(generic_shutdown_super);
478478

479479
bool mount_capable(struct fs_context *fc)
480480
{
481-
struct user_namespace *user_ns = fc->global ? &init_user_ns
482-
: fc->user_ns;
483-
484481
if (!(fc->fs_type->fs_flags & FS_USERNS_MOUNT))
485482
return capable(CAP_SYS_ADMIN);
486483
else
487-
return ns_capable(user_ns, CAP_SYS_ADMIN);
484+
return ns_capable(fc->user_ns, CAP_SYS_ADMIN);
488485
}
489486

490487
/**

0 commit comments

Comments
 (0)