lkml.org 
[lkml]   [2015]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] init/do_mounts: Add create_dev() failure log
Date
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


\
 
 \ /
  Last update: 2015-05-22 15:01    [W:0.077 / U:0.620 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site