Skip to content

Commit c33d442

Browse files
committed
debugfs: make error message a bit more verbose
When a file/directory is already present in debugfs, and it is attempted to be created again, be more specific about what file/directory is being created and where it is trying to be created to give a bit more help to developers to figure out the problem. Cc: Stephen Rothwell <[email protected]> Cc: Rafael J. Wysocki <[email protected]> Cc: Mark Brown <[email protected]> Cc: Takashi Iwai <[email protected]> Reviewed-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0979cf9 commit c33d442

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

fs/debugfs/inode.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,13 @@ static struct dentry *start_creating(const char *name, struct dentry *parent)
311311
inode_lock(d_inode(parent));
312312
dentry = lookup_one_len(name, parent, strlen(name));
313313
if (!IS_ERR(dentry) && d_really_is_positive(dentry)) {
314+
if (d_is_dir(dentry))
315+
pr_err("Directory '%s' with parent '%s' already present!\n",
316+
name, parent->d_name.name);
317+
else
318+
pr_err("File '%s' in directory '%s' already present!\n",
319+
name, parent->d_name.name);
314320
dput(dentry);
315-
pr_err("File '%s' already present!\n", name);
316321
dentry = ERR_PTR(-EEXIST);
317322
}
318323

0 commit comments

Comments
 (0)