Skip to contentSkip to conversation

makedumpfile: Improve error handing when SIZE(nodemask_t) is undefined

PATCH In review Bernhard Walle 2 participants 7 messages Jul 9, 2008 – Jul 10, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 makedumpfile: Improve error handing when SIZE(nodemask_t) is undefined

Hi,

I accidentally used a new makedumpfile with an old VMCOREINFO that did not contain the SIZE(nodemask_t). Then len was -1, and malloc(-1) failed. Which looked like memory was too low.

This patch just improves the error message in that case so that the user knows what is wrong.

---
 makedumpfile.c |    5 +++++
 1 file changed, 5 insertions(+)
makedumpfile.c +5 -0
diff -u -r1.7.2.37 makedumpfile.c
@@ -2580,6 +2580,11 @@
 	    && (SYMBOL(node_states) == NOT_FOUND_SYMBOL))
 		return 0;
 
+	if (SIZE(nodemask_t) == NOT_FOUND_LONG_VALUE) {
+		ERRMSG("SIZE(nodemask_t) undefined.\n");
+		return 0;
+	}
+
 	len = SIZE(nodemask_t);
 	vt.node_online_map_len = len/sizeof(unsigned long);
 	if (!(vt.node_online_map = (unsigned long *)malloc(len))) {

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#1 lore raw

Hi Bernhard,

Quoted 6 lines · Bernhard Walle

I accidentally used a new makedumpfile with an old VMCOREINFO that did not contain the SIZE(nodemask_t). Then len was -1, and malloc(-1) failed. Which looked like memory was too low.

This patch just improves the error message in that case so that the user knows what is wrong.

Thank you for the patch.
I agree to add this check method.

Quoted 10 lines
---
 makedumpfile.c |    5 +++++
 1 file changed, 5 insertions(+)

diff -u -r1.7.2.37 makedumpfile.c

makedumpfile.c line 2584

Quoted 5 lines
makedumpfile.c +2 -0
@@ -2580,6 +2580,11 @@
 	    && (SYMBOL(node_states) == NOT_FOUND_SYMBOL))
 		return 0;
 
+	if (SIZE(nodemask_t) == NOT_FOUND_LONG_VALUE) {
+		ERRMSG("SIZE(nodemask_t) undefined.\n");

I like the following message of the same form as another message.

ERRMSG("Can't get the size of nodemask_t.\n");

Thanks
Ken'ichi Ohmichi

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#2 lore raw
Quoted 8 lines · Ken'ichi Ohmichi

makedumpfile.c line 2584

Quoted 4 lines
makedumpfile.c +2 -0
+	if (SIZE(nodemask_t) == NOT_FOUND_LONG_VALUE) {
+		ERRMSG("SIZE(nodemask_t) undefined.\n");

I like the following message of the same form as another message.

ERRMSG("Can't get the size of nodemask_t.\n");

Sounds fine, thanks.

Bernhard

Signature · 6 lines
Bernhard Walle, SUSE LINUX Products GmbH, Architecture Development

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#3 lore raw

Hi Bernhard,

Quoted 8 lines · Bernhard Walle
Quoted 5 lines · Ken'ichi Ohmichi

makedumpfile.c line 2584

Quoted 2 lines
makedumpfile.c +2 -0
+	if (SIZE(nodemask_t) == NOT_FOUND_LONG_VALUE) {
+		ERRMSG("SIZE(nodemask_t) undefined.\n");

I like the following message of the same form as another message.

ERRMSG("Can't get the size of nodemask_t.\n");

Sounds fine, thanks.

Thank you for the response.
I merged this patch into DEVEL tree, and I'll merge it into the next release too.

Thanks
Ken'ichi Ohmichi

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#4 lore raw
Quoted 6 lines · Ken'ichi Ohmichi
Quoted 5 lines · Bernhard Walle
Quoted 4 lines · Ken'ichi Ohmichi

makedumpfile.c line 2584

Quoted 2 lines
makedumpfile.c +2 -0
+	if (SIZE(nodemask_t) == NOT_FOUND_LONG_VALUE) {
+		ERRMSG("SIZE(nodemask_t) undefined.\n");

I like the following message of the same form as another message.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

ERRMSG("Can't get the size of nodemask_t.\n");

Sounds fine, thanks.

Thank you for the response.
I merged this patch into DEVEL tree, and I'll merge it into the next release too.

Any plans when you make the next release?

Bernhard

Signature · 6 lines
Bernhard Walle, SUSE LINUX Products GmbH, Architecture Development

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#5 lore raw

Hi,

Quoted 7 lines · Bernhard Walle
Quoted 6 lines · Ken'ichi Ohmichi
Quoted 5 lines · Bernhard Walle
Quoted 4 lines · Ken'ichi Ohmichi

makedumpfile.c line 2584

Quoted 2 lines
makedumpfile.c +2 -0
+	if (SIZE(nodemask_t) == NOT_FOUND_LONG_VALUE) {
+		ERRMSG("SIZE(nodemask_t) undefined.\n");

I like the following message of the same form as another message.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Quoted 1 line

ERRMSG("Can't get the size of nodemask_t.\n");

Sounds fine, thanks.

Thank you for the response.
I merged this patch into DEVEL tree, and I'll merge it into the next release too.

Any plans when you make the next release?

I will do some tests, and will release it by 18 July.

Thanks
Ken'ichi Ohmichi

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#6 lore raw
Quoted 9 lines · Ken'ichi Ohmichi
Quoted 8 lines · Bernhard Walle
Quoted 7 lines · Ken'ichi Ohmichi
Quoted 6 lines · Bernhard Walle
Quoted 5 lines · Ken'ichi Ohmichi

makedumpfile.c line 2584

Quoted 2 lines
makedumpfile.c +2 -0
+	if (SIZE(nodemask_t) == NOT_FOUND_LONG_VALUE) {
+		ERRMSG("SIZE(nodemask_t) undefined.\n");

I like the following message of the same form as another message.

ERRMSG("Can't get the size of nodemask_t.\n");

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Sounds fine, thanks.

Thank you for the response.
I merged this patch into DEVEL tree, and I'll merge it into the next release too.

Any plans when you make the next release?

I will do some tests, and will release it by 18 July.

Sounds fine!

Bernhard

Signature · 6 lines
Bernhard Walle, SUSE LINUX Products GmbH, Architecture Development

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec