Commit c33d4423 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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 <sfr@canb.auug.org.au>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Takashi Iwai <tiwai@suse.de>
Reviewed-by: default avatarMark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20190706154256.GA2683@kroah.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0979cf95
...@@ -311,8 +311,13 @@ static struct dentry *start_creating(const char *name, struct dentry *parent) ...@@ -311,8 +311,13 @@ static struct dentry *start_creating(const char *name, struct dentry *parent)
inode_lock(d_inode(parent)); inode_lock(d_inode(parent));
dentry = lookup_one_len(name, parent, strlen(name)); dentry = lookup_one_len(name, parent, strlen(name));
if (!IS_ERR(dentry) && d_really_is_positive(dentry)) { if (!IS_ERR(dentry) && d_really_is_positive(dentry)) {
if (d_is_dir(dentry))
pr_err("Directory '%s' with parent '%s' already present!\n",
name, parent->d_name.name);
else
pr_err("File '%s' in directory '%s' already present!\n",
name, parent->d_name.name);
dput(dentry); dput(dentry);
pr_err("File '%s' already present!\n", name);
dentry = ERR_PTR(-EEXIST); dentry = ERR_PTR(-EEXIST);
} }
......
Markdown is supported
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