All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kdump: print a message in case crashkernel size parsing resulted in zero bytes
@ 2017-11-13  5:43 Dave Young
  2017-11-13  8:49   ` Bhupesh Sharma
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Young @ 2017-11-13  5:43 UTC (permalink / raw)
  To: kexec; +Cc: akpm, vgoyal, bhe

In parse_crashkernel_mem, it silently return in case we get zero
bytes in the parsing function.  It is useful for debugging for
adding a warning message especially sometimes kernel can not boot
up correctly.

Signed-off-by: Dave Young <dyoung@redhat.com>
---
 kernel/crash_core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- linux-x86.orig/kernel/crash_core.c
+++ linux-x86/kernel/crash_core.c
@@ -108,7 +108,8 @@ static int __init parse_crashkernel_mem(
 				return -EINVAL;
 			}
 		}
-	}
+	} else
+		pr_warn("crashkernel size resulted in zero bytes\n");
 
 	return 0;
 }

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] kdump: print a message in case crashkernel size parsing resulted in zero bytes
  2017-11-13  5:43 [PATCH] kdump: print a message in case crashkernel size parsing resulted in zero bytes Dave Young
@ 2017-11-13  8:49   ` Bhupesh Sharma
  0 siblings, 0 replies; 3+ messages in thread
From: Bhupesh Sharma @ 2017-11-13  8:49 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Dave,

Cc: arm kernel mailing list for wider distribution

On 11/13/2017 11:13 AM, Dave Young wrote:
> In parse_crashkernel_mem, it silently return in case we get zero
> bytes in the parsing function.  It is useful for debugging for
> adding a warning message especially sometimes kernel can not boot
> up correctly.
>
> Signed-off-by: Dave Young <dyoung@redhat.com>
> ---
>  kernel/crash_core.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> --- linux-x86.orig/kernel/crash_core.c
> +++ linux-x86/kernel/crash_core.c
> @@ -108,7 +108,8 @@ static int __init parse_crashkernel_mem(
>                  return -EINVAL;
>              }
>          }
> -    }
> +    } else
> +        pr_warn("crashkernel size resulted in zero bytes\n");
>
>      return 0;
>  }
>
This is a useful change as finding this debug message in the boot logs allows better debug of crashkernel related issues.

However I have one minor point:

- The comment above 'parse_crashkernel_mem' currently mentions:
  * The function returns 0 on success and -EINVAL on failure.
  */

- I am wondering if we hit the WARNING case where the crashkernel size resulted in 0 bytes, then should we still be returning 0 from this function. Or, should this be replaced with 'return -EINVAL'.

- If not, can we atleast update the comment above this function to better document the return values and where having a 'return 0' should be ok, even if crashkernel size resulted in 0 bytes.

Regards,
Bhupesh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kdump: print a message in case crashkernel size parsing resulted in zero bytes
@ 2017-11-13  8:49   ` Bhupesh Sharma
  0 siblings, 0 replies; 3+ messages in thread
From: Bhupesh Sharma @ 2017-11-13  8:49 UTC (permalink / raw)
  To: Dave Young; +Cc: linux-arm-kernel, akpm, kexec, bhe, vgoyal

Hi Dave,

Cc: arm kernel mailing list for wider distribution

On 11/13/2017 11:13 AM, Dave Young wrote:
> In parse_crashkernel_mem, it silently return in case we get zero
> bytes in the parsing function.  It is useful for debugging for
> adding a warning message especially sometimes kernel can not boot
> up correctly.
>
> Signed-off-by: Dave Young <dyoung@redhat.com>
> ---
>  kernel/crash_core.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> --- linux-x86.orig/kernel/crash_core.c
> +++ linux-x86/kernel/crash_core.c
> @@ -108,7 +108,8 @@ static int __init parse_crashkernel_mem(
>                  return -EINVAL;
>              }
>          }
> -    }
> +    } else
> +        pr_warn("crashkernel size resulted in zero bytes\n");
>
>      return 0;
>  }
>
This is a useful change as finding this debug message in the boot logs allows better debug of crashkernel related issues.

However I have one minor point:

- The comment above 'parse_crashkernel_mem' currently mentions:
  * The function returns 0 on success and -EINVAL on failure.
  */

- I am wondering if we hit the WARNING case where the crashkernel size resulted in 0 bytes, then should we still be returning 0 from this function. Or, should this be replaced with 'return -EINVAL'.

- If not, can we atleast update the comment above this function to better document the return values and where having a 'return 0' should be ok, even if crashkernel size resulted in 0 bytes.

Regards,
Bhupesh

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-13  8:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-13  5:43 [PATCH] kdump: print a message in case crashkernel size parsing resulted in zero bytes Dave Young
2017-11-13  8:49 ` Bhupesh Sharma
2017-11-13  8:49   ` Bhupesh Sharma

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.