Skip to content

Commit

Permalink
init/do_mounts.c: add create_dev() failure log
Browse files Browse the repository at this point in the history
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.

[[email protected]: simplify printk(), use pr_emerg(), display errno]
Signed-off-by: Vishnu Pratap Singh <[email protected]>
Acked-by: Pavel Machek <[email protected]>
Cc: Paul Gortmaker <[email protected]>
Cc: Mike Snitzer <[email protected]>
Cc: Dan Ehrenberg <[email protected]>
Cc: Miklos Szeredi <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Vishnu Pratap Singh authored and torvalds committed Jun 26, 2015
1 parent bffacb9 commit c69e3c3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions init/do_mounts.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,13 @@ void __init mount_root(void)
}
#endif
#ifdef CONFIG_BLOCK
create_dev("/dev/root", ROOT_DEV);
mount_block_root("/dev/root", root_mountflags);
{
int err = create_dev("/dev/root", ROOT_DEV);

if (err < 0)
pr_emerg("Failed to create /dev/root: %d\n", err);
mount_block_root("/dev/root", root_mountflags);
}
#endif
}

Expand Down

0 comments on commit c69e3c3

Please sign in to comment.