]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
debugfs: remove duplicate checks in callers of start_creating()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 19 Sep 2025 22:58:42 +0000 (18:58 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 16 Nov 2025 06:35:03 +0000 (01:35 -0500)
we'd already verified that DEBUGFS_ALLOW_API was there in
start_creating() - it would've failed otherwise

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/debugfs/inode.c

index 682120fdbb17bb4d8f2c372df6f09925181cd9c9..25a554331ac4f46ae4ebb0d15745839d17f2b523 100644 (file)
@@ -433,11 +433,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",
@@ -583,11 +578,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",
@@ -630,11 +620,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",