From: Simon Horman <horms@verge.net.au>
To: Dave Young <dyoung@redhat.com>
Cc: kexec@lists.infradead.org
Subject: Re: [PATCH 2/2] kernel image probe function return value checking fix
Date: Thu, 6 Feb 2014 16:30:56 +0900 [thread overview]
Message-ID: <20140206073056.GF24865@verge.net.au> (raw)
In-Reply-To: <1391668244-13631-3-git-send-email-dyoung@redhat.com>
On Thu, Feb 06, 2014 at 02:30:44PM +0800, Dave Young wrote:
> Currently kexec will use the kernel image type when probe function return
> value >=0. It looks odd, but previously it works. Since commit bf06cf2095
> it does not work anymore.
>
> During my testing for arm zImage, in 2nd kernel the atags pointer and the
> machine_id are not valid, I did a lot of debugging in kernel, finally I found
> this is caused by a kexec tools bug instead.
>
> Because uImage will be probed before zImage, also the uImage probe return 1
> instead of -1 since bf06cf2095, thus kexec will mistakenly think it is uImage.
>
> Fix this issue by regarding it's valid only when probe return 0.
>
> Signed-off-by: Dave Young <dyoung@redhat.com>
Thanks, applied.
> ---
> kexec/kexec.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kexec/kexec.c b/kexec/kexec.c
> index f13e512..703d524 100644
> --- a/kexec/kexec.c
> +++ b/kexec/kexec.c
> @@ -691,7 +691,7 @@ static int my_load(const char *type, int fileind, int argc, char **argv,
> }
> if (!type || guess_only) {
> for (i = 0; i < file_types; i++) {
> - if (file_type[i].probe(kernel_buf, kernel_size) >= 0)
> + if (file_type[i].probe(kernel_buf, kernel_size) == 0)
> break;
> }
> if (i == file_types) {
> --
> 1.8.3.1
>
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
prev parent reply other threads:[~2014-02-06 7:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-06 6:30 [PATCH 0/2] kernel probe function fixes Dave Young
2014-02-06 6:30 ` [PATCH 1/2] zImage_ppc64_probe: return 0 instead of 1 in case of success Dave Young
2014-02-06 7:30 ` Simon Horman
2014-02-06 6:30 ` [PATCH 2/2] kernel image probe function return value checking fix Dave Young
2014-02-06 7:30 ` 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=20140206073056.GF24865@verge.net.au \
--to=horms@verge.net.au \
--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