diff options
author | Vishnu Pratap Singh <vishnu.ps@samsung.com> | 2015-06-25 18:03:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-06-25 20:00:42 -0400 |
commit | c69e3c3a0c014e86750e78b7e2ae823f7a9b2cb2 (patch) | |
tree | 6beedc654dba473ab2d098a4d92638633601dd5a /init/do_mounts.c | |
parent | bffacb9132a306b7e22bb6366e5b277f20f67465 (diff) |
init/do_mounts.c: add create_dev() failure log
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 printk in this case. So I have added the log in case it fails to
create the root device. It will help in debugging.
[akpm@linux-foundation.org: simplify printk(), use pr_emerg(), display errno]
Signed-off-by: Vishnu Pratap Singh <vishnu.ps@samsung.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: Dan Ehrenberg <dehrenberg@chromium.org>
Cc: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'init/do_mounts.c')
-rw-r--r-- | init/do_mounts.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/init/do_mounts.c b/init/do_mounts.c index a95bbdb2a502..dea5de95c2dd 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c | |||
@@ -533,8 +533,13 @@ void __init mount_root(void) | |||
533 | } | 533 | } |
534 | #endif | 534 | #endif |
535 | #ifdef CONFIG_BLOCK | 535 | #ifdef CONFIG_BLOCK |
536 | create_dev("/dev/root", ROOT_DEV); | 536 | { |
537 | mount_block_root("/dev/root", root_mountflags); | 537 | int err = create_dev("/dev/root", ROOT_DEV); |
538 | |||
539 | if (err < 0) | ||
540 | pr_emerg("Failed to create /dev/root: %d\n", err); | ||
541 | mount_block_root("/dev/root", root_mountflags); | ||
542 | } | ||
538 | #endif | 543 | #endif |
539 | } | 544 | } |
540 | 545 | ||