Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: Andrew Jones <drjones@redhat.com>
Cc: kexec@lists.infradead.org, Dave Young <dyoung@redhat.com>
Subject: Re: [PATCH update] kexec/fs2dt.c: wrong dt node fix
Date: Wed, 2 Mar 2016 09:14:58 +0900	[thread overview]
Message-ID: <20160302001458.GD17986@verge.net.au> (raw)
In-Reply-To: <20160226133920.5ffzizkxxsp4jggl@hawk.localdomain>

On Fri, Feb 26, 2016 at 02:39:20PM +0100, Andrew Jones wrote:
> On Fri, Feb 26, 2016 at 07:57:55PM +0800, Dave Young wrote:
> > 2nd kernel hangs early because of a regression caused by below commit:
> > commit 68262155d8c661586b809bc5301a7dff1c378137
> > Author: Andrew Jones <drjones@redhat.com>
> > Date:   Fri Nov 20 12:31:53 2015 -0500
> > 
> >     kexec/fs2dt: cleanup pathname
> >     
> >     putnode() will add the trailing '/', avoid having two. Also
> >     pathstart is unused, get rid of it.
> >     
> >     Signed-off-by: Andrew Jones <drjones@redhat.com>
> >     Signed-off-by: Simon Horman <horms@verge.net.au>
> > 
> > The actual purpose of the commit is to avoid double slash in pathname.
> > But unfortunately in function putnode() we have below magics to get the node
> > name:
> > 	basename = strrchr(pathname,'/') + 1;
> > 	...
> > 	strcpy((void *)dt, *basename ? basename : "");
> > 	...
> > 	strcat(pathname, "/");
> > 
> > We treat none zero basename as a node name, then concat a slash to open the
> > directory for later property handling.
> > pathname originally was "/proc/device-tree/" so for the first run of putnode
> > it will cause double slashes. With the commit above mentioned there are no
> > double slashes but we will copy "device-tree" to dt. Thus kexec kernel is not
> > happy..
> > 
> > Instead let's fix it by only concating slash when the basenanme is not empty
> > and restore the initial value of pathname as "/proc/device-tree/"
> > 
> > Note: I only reproduce the issue with loading older kernel like 3.10 in RHEL. I do
> > not see the problem in new kernels in Fedora.
> > 
> > Signed-off-by: Dave Young <dyoung@redhat.com>
> 
> Err.. sorry I missed that strrchr() for the basename.
> 
> Reviewed-by: Andrew Jones <drjones@redhat.com>

Thanks, applied.

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

      reply	other threads:[~2016-03-02  0:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26 11:57 [PATCH update] kexec/fs2dt.c: wrong dt node fix Dave Young
2016-02-26 13:39 ` Andrew Jones
2016-03-02  0:14   ` Simon Horman [this message]

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=20160302001458.GD17986@verge.net.au \
    --to=horms@verge.net.au \
    --cc=drjones@redhat.com \
    --cc=dyoung@redhat.com \
    --cc=kexec@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox