All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: Vishnu Pratap Singh <vishnu.ps@samsung.com>,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Cc: cpgs@samsung.com
Subject: Re: [PATCH] init/do_mounts: Add create_dev() failure log
Date: Fri, 22 May 2015 09:48:24 -0700	[thread overview]
Message-ID: <555F5DD8.8070700@infradead.org> (raw)
In-Reply-To: <1432298274-7708-1-git-send-email-vishnu.ps@samsung.com>

On 05/22/15 05:37, Vishnu Pratap Singh wrote:
> 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)

	if (ret < 0)

> +		printk(KERN_ERR " Failed to create %s device !! err: %d\n", name, ret);

Don't need space before 'Failed'.

> +	return ret;
>  }
>  
>  #if BITS_PER_LONG == 32
> 


-- 
~Randy

  reply	other threads:[~2015-05-22 16:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22 12:37 [PATCH] init/do_mounts: Add create_dev() failure log Vishnu Pratap Singh
2015-05-22 16:48 ` Randy Dunlap [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=555F5DD8.8070700@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=cpgs@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vishnu.ps@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.