netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix infinite retry loop in IP-Config
@ 2009-01-28  9:07 Benjamin ZORES
  2009-01-28 10:52 ` Jarek Poplawski
  0 siblings, 1 reply; 7+ messages in thread
From: Benjamin ZORES @ 2009-01-28  9:07 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 498 bytes --]

Hi,

The attached patch fixes some bug with ip-config max retry number.
In ip_auto_config(), kernel tries to retrieve IP configuration forever
in case of NFS root and some specific amount of time otherwise.

The problem is that, in case of error, the code jump to the try_try_again
goto statement, that reassigns the retry number counter, which obviously
leads to an infinite loop if IP config fails.

The attached patch corrects this behavior.
Hope one can push it to mainstream kernel tree.

Ben

[-- Attachment #2: netdev-ipconfig-retry-fix.diff --]
[-- Type: text/x-diff, Size: 594 bytes --]

diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 42a0f3d..4911b81 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -1268,6 +1268,7 @@ __be32 __init root_nfs_parse_addr(char *name)
 static int __init ip_auto_config(void)
 {
 	__be32 addr;
+	 int retries = CONF_OPEN_RETRIES;
 
 #ifdef CONFIG_PROC_FS
 	proc_net_fops_create(&init_net, "pnp", S_IRUGO, &pnp_seq_fops);
@@ -1305,8 +1306,6 @@ static int __init ip_auto_config(void)
 	    ic_first_dev->next) {
 #ifdef IPCONFIG_DYNAMIC
 
-		int retries = CONF_OPEN_RETRIES;
-
 		if (ic_dynamic() < 0) {
 			ic_close_devs();
 

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

* Re: [PATCH] Fix infinite retry loop in IP-Config
  2009-01-28  9:07 [PATCH] Fix infinite retry loop in IP-Config Benjamin ZORES
@ 2009-01-28 10:52 ` Jarek Poplawski
  2009-01-28 12:08   ` Benjamin ZORES
  0 siblings, 1 reply; 7+ messages in thread
From: Jarek Poplawski @ 2009-01-28 10:52 UTC (permalink / raw)
  To: Benjamin ZORES; +Cc: netdev

On 28-01-2009 10:07, Benjamin ZORES wrote:
> Hi,
> 
> The attached patch fixes some bug with ip-config max retry number.
> In ip_auto_config(), kernel tries to retrieve IP configuration forever
> in case of NFS root and some specific amount of time otherwise.
> 
> The problem is that, in case of error, the code jump to the try_try_again
> goto statement, that reassigns the retry number counter, which obviously
> leads to an infinite loop if IP config fails.
> 
> The attached patch corrects this behavior.
> Hope one can push it to mainstream kernel tree.
> 
> Ben
> 
> diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
> index 42a0f3d..4911b81 100644
> --- a/net/ipv4/ipconfig.c
> +++ b/net/ipv4/ipconfig.c
> @@ -1268,6 +1268,7 @@ __be32 __init root_nfs_parse_addr(char *name)
>  static int __init ip_auto_config(void)
>  {
>  	__be32 addr;
> +	 int retries = CONF_OPEN_RETRIES;
 
Doesn't it need "#ifdef IPCONFIG_DYNAMIC" to prevent a compiler
warning? I guess you could add a "Signed-off-by:" line BTW.

Jarek P.

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

* Re: [PATCH] Fix infinite retry loop in IP-Config
  2009-01-28 10:52 ` Jarek Poplawski
@ 2009-01-28 12:08   ` Benjamin ZORES
  2009-01-29 15:33     ` Benjamin ZORES
  2009-01-30  0:19     ` David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Benjamin ZORES @ 2009-01-28 12:08 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 1168 bytes --]

Jarek Poplawski a écrit :
> On 28-01-2009 10:07, Benjamin ZORES wrote:
>   
>> Hi,
>>
>> The attached patch fixes some bug with ip-config max retry number.
>> In ip_auto_config(), kernel tries to retrieve IP configuration forever
>> in case of NFS root and some specific amount of time otherwise.
>>
>> The problem is that, in case of error, the code jump to the try_try_again
>> goto statement, that reassigns the retry number counter, which obviously
>> leads to an infinite loop if IP config fails.
>>
>> The attached patch corrects this behavior.
>> Hope one can push it to mainstream kernel tree.
>>
>> Ben
>>
>> diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
>> index 42a0f3d..4911b81 100644
>> --- a/net/ipv4/ipconfig.c
>> +++ b/net/ipv4/ipconfig.c
>> @@ -1268,6 +1268,7 @@ __be32 __init root_nfs_parse_addr(char *name)
>>  static int __init ip_auto_config(void)
>>  {
>>  	__be32 addr;
>> +	 int retries = CONF_OPEN_RETRIES;
>>     
>  
> Doesn't it need "#ifdef IPCONFIG_DYNAMIC" to prevent a compiler
> warning? I guess you could add a "Signed-off-by:" line BTW.
>   
You're perfectly right about this.
Attached an updated version of the patch.

Ben

[-- Attachment #2: netdev-ipconfig-retry-fix.diff --]
[-- Type: text/x-diff, Size: 952 bytes --]

commit 4f9928e4ed6aae2a4c2f2216cab1c16e38631a88
Author: Benjamin Zores <benjamin.zores@alcatel-lucent.fr>
Signed-off-by: Benjamin Zores <benjamin.zores@alcatel-lucent.fr>
Date:   Wed Jan 28 13:03:07 2009 +0100

    fix infinite retry loop in IP-Config

diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 42a0f3d..5fad34d 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -1268,6 +1268,9 @@ __be32 __init root_nfs_parse_addr(char *name)
 static int __init ip_auto_config(void)
 {
        __be32 addr;
+#ifdef IPCONFIG_DYNAMIC
+        int retries = CONF_OPEN_RETRIES;
+#endif
 
 #ifdef CONFIG_PROC_FS
        proc_net_fops_create(&init_net, "pnp", S_IRUGO, &pnp_seq_fops);
@@ -1305,8 +1308,6 @@ static int __init ip_auto_config(void)
            ic_first_dev->next) {
 #ifdef IPCONFIG_DYNAMIC
 
-               int retries = CONF_OPEN_RETRIES;
-
                if (ic_dynamic() < 0) {
                        ic_close_devs();
 



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

* Re: [PATCH] Fix infinite retry loop in IP-Config
  2009-01-28 12:08   ` Benjamin ZORES
@ 2009-01-29 15:33     ` Benjamin ZORES
  2009-01-29 20:39       ` David Miller
  2009-01-30  0:19     ` David Miller
  1 sibling, 1 reply; 7+ messages in thread
From: Benjamin ZORES @ 2009-01-29 15:33 UTC (permalink / raw)
  To: netdev

Benjamin ZORES a écrit :
> Jarek Poplawski a écrit :
>> On 28-01-2009 10:07, Benjamin ZORES wrote:
>>  
>>> Hi,
>>>
>>> The attached patch fixes some bug with ip-config max retry number.
>>> In ip_auto_config(), kernel tries to retrieve IP configuration forever
>>> in case of NFS root and some specific amount of time otherwise.
>>>
>>> The problem is that, in case of error, the code jump to the 
>>> try_try_again
>>> goto statement, that reassigns the retry number counter, which 
>>> obviously
>>> leads to an infinite loop if IP config fails.
>>>
>>> The attached patch corrects this behavior.
>>> Hope one can push it to mainstream kernel tree.
>>>
>>> Ben
>>>
>>> diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
>>> index 42a0f3d..4911b81 100644
>>> --- a/net/ipv4/ipconfig.c
>>> +++ b/net/ipv4/ipconfig.c
>>> @@ -1268,6 +1268,7 @@ __be32 __init root_nfs_parse_addr(char *name)
>>>  static int __init ip_auto_config(void)
>>>  {
>>>      __be32 addr;
>>> +     int retries = CONF_OPEN_RETRIES;
>>>     
>>  
>> Doesn't it need "#ifdef IPCONFIG_DYNAMIC" to prevent a compiler
>> warning? I guess you could add a "Signed-off-by:" line BTW.
>>   
> You're perfectly right about this.
> Attached an updated version of the patch.
Any chance of having it merged ?

Ben

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

* Re: [PATCH] Fix infinite retry loop in IP-Config
  2009-01-29 15:33     ` Benjamin ZORES
@ 2009-01-29 20:39       ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2009-01-29 20:39 UTC (permalink / raw)
  To: benjamin.zores; +Cc: netdev

From: Benjamin ZORES <benjamin.zores@alcatel-lucent.fr>
Date: Thu, 29 Jan 2009 16:33:35 +0100

> Any chance of having it merged ?

Please be patient, I haven't even had a chance to
read over your patch yet.

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

* Re: [PATCH] Fix infinite retry loop in IP-Config
  2009-01-28 12:08   ` Benjamin ZORES
  2009-01-29 15:33     ` Benjamin ZORES
@ 2009-01-30  0:19     ` David Miller
  2009-01-30  8:25       ` Benjamin ZORES
  1 sibling, 1 reply; 7+ messages in thread
From: David Miller @ 2009-01-30  0:19 UTC (permalink / raw)
  To: benjamin.zores; +Cc: netdev

From: Benjamin ZORES <benjamin.zores@alcatel-lucent.fr>
Date: Wed, 28 Jan 2009 13:08:15 +0100

> Jarek Poplawski a écrit :
> > On 28-01-2009 10:07, Benjamin ZORES wrote:
> >   
> >> diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
> >> index 42a0f3d..4911b81 100644
> >> --- a/net/ipv4/ipconfig.c
> >> +++ b/net/ipv4/ipconfig.c
> >> @@ -1268,6 +1268,7 @@ __be32 __init root_nfs_parse_addr(char *name)
> >>  static int __init ip_auto_config(void)
> >>  {
> >>  	__be32 addr;
> >> +	 int retries = CONF_OPEN_RETRIES;
> >>     
> >  Doesn't it need "#ifdef IPCONFIG_DYNAMIC" to prevent a compiler
> > warning? I guess you could add a "Signed-off-by:" line BTW.
> >   
> You're perfectly right about this.
> Attached an updated version of the patch.

Patch applied, thank you.

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

* Re: [PATCH] Fix infinite retry loop in IP-Config
  2009-01-30  0:19     ` David Miller
@ 2009-01-30  8:25       ` Benjamin ZORES
  0 siblings, 0 replies; 7+ messages in thread
From: Benjamin ZORES @ 2009-01-30  8:25 UTC (permalink / raw)
  To: netdev

David Miller a écrit :
> From: Benjamin ZORES <benjamin.zores@alcatel-lucent.fr>
> Date: Wed, 28 Jan 2009 13:08:15 +0100
>
>   
>> Jarek Poplawski a écrit :
>>     
>>> On 28-01-2009 10:07, Benjamin ZORES wrote:
>>>   
>>>       
>>>> diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
>>>> index 42a0f3d..4911b81 100644
>>>> --- a/net/ipv4/ipconfig.c
>>>> +++ b/net/ipv4/ipconfig.c
>>>> @@ -1268,6 +1268,7 @@ __be32 __init root_nfs_parse_addr(char *name)
>>>>  static int __init ip_auto_config(void)
>>>>  {
>>>>  	__be32 addr;
>>>> +	 int retries = CONF_OPEN_RETRIES;
>>>>     
>>>>         
>>>  Doesn't it need "#ifdef IPCONFIG_DYNAMIC" to prevent a compiler
>>> warning? I guess you could add a "Signed-off-by:" line BTW.
>>>   
>>>       
>> You're perfectly right about this.
>> Attached an updated version of the patch.
>>     
>
> Patch applied, thank you.
Be my guest. Thanks to you.

Ben

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

end of thread, other threads:[~2009-01-30  8:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-28  9:07 [PATCH] Fix infinite retry loop in IP-Config Benjamin ZORES
2009-01-28 10:52 ` Jarek Poplawski
2009-01-28 12:08   ` Benjamin ZORES
2009-01-29 15:33     ` Benjamin ZORES
2009-01-29 20:39       ` David Miller
2009-01-30  0:19     ` David Miller
2009-01-30  8:25       ` Benjamin ZORES

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).