linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] init/do_mounts: Add create_dev() failure log
@ 2015-05-22 12:37 Vishnu Pratap Singh
  2015-05-22 16:48 ` Randy Dunlap
  0 siblings, 1 reply; 7+ messages in thread
From: Vishnu Pratap Singh @ 2015-05-22 12:37 UTC (permalink / raw)
  To: vishnu.ps, akpm, linux-kernel; +Cc: cpgs

if create_dev() function fails to create the root mount device (/dev/root),
then it goes to panic as root device not found but there is no check/log
present in case of failure, So i have added the log in case it fails to create
the root device. It will help in debugging.

Signed-off-by: Vishnu Pratap Singh <vishnu.ps@samsung.com>
---
 init/do_mounts.h |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/init/do_mounts.h b/init/do_mounts.h
index f5b978a..40c85e9 100644
--- a/init/do_mounts.h
+++ b/init/do_mounts.h
@@ -15,8 +15,12 @@ extern int root_mountflags;
 
 static inline int create_dev(char *name, dev_t dev)
 {
+	int ret;
 	sys_unlink(name);
-	return sys_mknod(name, S_IFBLK|0600, new_encode_dev(dev));
+	ret = sys_mknod(name, S_IFBLK|0600, new_encode_dev(dev));
+	if(ret < 0)
+		printk(KERN_ERR " Failed to create %s device !! err: %d\n", name, ret);
+	return ret;
 }
 
 #if BITS_PER_LONG == 32
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread
[parent not found: <130285@samsung.com>]

end of thread, other threads:[~2015-05-26  6:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-22 12:37 [PATCH] init/do_mounts: Add create_dev() failure log Vishnu Pratap Singh
2015-05-22 16:48 ` Randy Dunlap
2015-05-22 19:44   ` Andrew Morton
     [not found] <130285@samsung.com>
2015-05-25  5:17 ` Vishnu Pratap Singh
2015-05-25 12:59   ` Pavel Machek
2015-05-25 13:49   ` Vishnu Pratap Singh
2015-05-26  6:25     ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).