we'd already verified that DEBUGFS_ALLOW_API was there in
start_creating() - it would've failed otherwise

Signed-off-by: Al Viro <v...@zeniv.linux.org.uk>
---
 fs/debugfs/inode.c | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index 1302995d6816..95eb57566d26 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -432,11 +432,6 @@ static struct dentry *__debugfs_create_file(const char 
*name, umode_t mode,
        if (IS_ERR(dentry))
                return dentry;
 
-       if (!(debugfs_allow & DEBUGFS_ALLOW_API)) {
-               failed_creating(dentry);
-               return ERR_PTR(-EPERM);
-       }
-
        inode = debugfs_get_inode(dentry->d_sb);
        if (unlikely(!inode)) {
                pr_err("out of free dentries, can not create file '%s'\n",
@@ -582,11 +577,6 @@ struct dentry *debugfs_create_dir(const char *name, struct 
dentry *parent)
        if (IS_ERR(dentry))
                return dentry;
 
-       if (!(debugfs_allow & DEBUGFS_ALLOW_API)) {
-               failed_creating(dentry);
-               return ERR_PTR(-EPERM);
-       }
-
        inode = debugfs_get_inode(dentry->d_sb);
        if (unlikely(!inode)) {
                pr_err("out of free dentries, can not create directory '%s'\n",
@@ -629,11 +619,6 @@ struct dentry *debugfs_create_automount(const char *name,
        if (IS_ERR(dentry))
                return dentry;
 
-       if (!(debugfs_allow & DEBUGFS_ALLOW_API)) {
-               failed_creating(dentry);
-               return ERR_PTR(-EPERM);
-       }
-
        inode = debugfs_get_inode(dentry->d_sb);
        if (unlikely(!inode)) {
                pr_err("out of free dentries, can not create automount '%s'\n",
-- 
2.47.3


Reply via email to