* [PATCH] debugfs: make error message a bit more verbose
@ 2019-07-06 15:42 Greg Kroah-Hartman
2019-07-06 15:53 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Greg Kroah-Hartman @ 2019-07-06 15:42 UTC (permalink / raw)
To: linux-kernel
Cc: Stephen Rothwell, Rafael J. Wysocki, Mark Brown, Takashi Iwai
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/debugfs/inode.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index 7f43c8acfcbf..5836312269e0 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -311,8 +311,13 @@ static struct dentry *start_creating(const char *name, struct dentry *parent)
inode_lock(d_inode(parent));
dentry = lookup_one_len(name, parent, strlen(name));
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);
- pr_err("File '%s' already present!\n", name);
dentry = ERR_PTR(-EEXIST);
}
--
2.22.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] debugfs: make error message a bit more verbose
2019-07-06 15:42 [PATCH] debugfs: make error message a bit more verbose Greg Kroah-Hartman
@ 2019-07-06 15:53 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2019-07-06 15:53 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: linux-kernel, Stephen Rothwell, Rafael J. Wysocki, Takashi Iwai
[-- Attachment #1: Type: text/plain, Size: 378 bytes --]
On Sat, Jul 06, 2019 at 05:42:56PM +0200, Greg Kroah-Hartman wrote:
> 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.
Reviewed-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-06 15:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-06 15:42 [PATCH] debugfs: make error message a bit more verbose Greg Kroah-Hartman
2019-07-06 15:53 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.