From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757588AbbEVQsc (ORCPT ); Fri, 22 May 2015 12:48:32 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:46371 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756992AbbEVQsZ (ORCPT ); Fri, 22 May 2015 12:48:25 -0400 Message-ID: <555F5DD8.8070700@infradead.org> Date: Fri, 22 May 2015 09:48:24 -0700 From: Randy Dunlap User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Vishnu Pratap Singh , akpm@linux-foundation.org, linux-kernel@vger.kernel.org CC: cpgs@samsung.com Subject: Re: [PATCH] init/do_mounts: Add create_dev() failure log References: <1432298274-7708-1-git-send-email-vishnu.ps@samsung.com> In-Reply-To: <1432298274-7708-1-git-send-email-vishnu.ps@samsung.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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