Commit f5b7769e authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Revert "debugfs: inode: debugfs_create_dir uses mode permission from parent"

This reverts commit 95cde3c5


The commit had good intentions, but it breaks kvm-tool and qemu-kvm.

With it in place, "lkvm run" just fails with

  Error: KVM_CREATE_VM ioctl
  Warning: Failed init: kvm__init

which isn't a wonderful error message, but bisection pinpointed the
problematic commit.

The problem is almost certainly due to the special kvm debugfs entries
created dynamically by kvm under /sys/kernel/debug/kvm/.  See

Bisected-and-reported-by: default avatarLinus Torvalds <>
Cc: Wanpeng Li <>
Cc: Greg Kroah-Hartman <>
Cc: Thomas Richter <>
Cc: Kees Cook <>
Signed-off-by: default avatarLinus Torvalds <>
parent dbee3d02
......@@ -512,9 +512,7 @@ struct dentry *debugfs_create_dir(const char *name, struct dentry *parent)
if (unlikely(!inode))
return failed_creating(dentry);
if (!parent)
parent = debugfs_mount->mnt_root;
inode->i_mode = S_IFDIR | ((d_inode(parent)->i_mode & 0770));
inode->i_mode = S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO;
inode->i_op = &simple_dir_inode_operations;
inode->i_fop = &simple_dir_operations;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment