Skip to contentSkip to conversation

kernel-2.6.9: make sock_init() notice errors

KJ Domen Puncer 3 participants 4 messages Dec 15, 2004 – Dec 18, 2004 Kernel janitors

lore
Share & tools
lore
#0 lore raw
Quoted 5 lines · walter harms

Hi list,
by accident i found that that sock_init never checks the return code of called init functions. I have no idea why this is not done so i added only a printk() to inform the user about the problem.
The function returns no error indicator. i left it this way.

I don't like this patch: it doesn't really do anything useful... ie. if user runs out of memory on boot, he'll have other problems than caring about sock_init failing somewhere.

Comments?

Also, there's still whitespace damage like:

Review

Quoted 2 lines
(quoted diff) +2 -0
+	ret=init_inodecache();
+	if ( ret < 0 ) {

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw

Hi domen, hi list,

its true that the user can not do much about missing memmory but he should know WHAT error occured. NTL not checking returncodes is an error.
Continuing when one earlier function did not work is also an error and may cause problems in unexspected places. Since this is an init code its no performance consideration to be made.

re,
walter

Quoted 13 lines · Domen Puncer
Quoted 5 lines · walter harms

Hi list,
by accident i found that that sock_init never checks the return code of called init functions. I have no idea why this is not done so i added only a printk() to inform the user about the problem.
The function returns no error indicator. i left it this way.

I don't like this patch: it doesn't really do anything useful... ie. if user runs out of memory on boot, he'll have other problems than caring about sock_init failing somewhere.

Quoted 9 lines

Comments?

Also, there's still whitespace damage like:

Review

Quoted 2 lines
(quoted diff) +2 -0
+	ret=init_inodecache();
+	if ( ret < 0 ) {

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#2 lore raw
In reply to Domen Puncer
Quoted 9 lines · Domen Puncer
Quoted 5 lines · walter harms

Hi list,
by accident i found that that sock_init never checks the return code of called init functions. I have no idea why this is not done so i added only a printk() to inform the user about the problem.
The function returns no error indicator. i left it this way.

Quoted 5 lines

I don't like this patch: it doesn't really do anything useful... ie. if user runs out of memory on boot, he'll have other problems than caring about sock_init failing somewhere.

Comments?

Better have a message that gives a clue about where things went wrong than nothing.

If a function is not to be checked against failure, convert it to return void 8) IOW: always check non void returning functions.

- Arnaldo
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#3 lore raw
In reply to Domen Puncer
Quoted 9 lines · walter harms

Hi domen, hi list,

its true that the user can not do much about missing memmory but he should know WHAT error occured.
NTL not checking returncodes is an error.
Continuing when one earlier function did not work is also an error and may cause problems in unexspected places.
Since this is an init code its no performance consideration to be made.

Ok, fair enough; if you fix whitespace i'll include it.

Quoted 11 lines

re,
walter

Quoted 4 lines · Domen Puncer

Also, there's still whitespace damage like:

Review

Quoted 2 lines
(quoted diff) +2 -0
+	ret=init_inodecache();
+	if ( ret < 0 ) {

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors