Skip to contentSkip to conversation

nfs: NfsTimeout() updates

PATCH New Peter Tyser 3 participants 4 messages Nov 10, 2009 – Dec 7, 2009 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfs: NfsTimeout() updates

From: Evan Samanas <[email protected]>

- NfsTimeout() does not correctly update the NFS timeout value which results in NfsTimeout() only being called once in certain situations. This can result in the 'nfs' command hanging indefinetly. For example, the command:

    nfs 192.168.0.1:/home/user/file

will not exit until ctrl-c is pressed if 192.168.0.1 does not have an NFS server running.

This issue is resolved by reinitializting the NFS timeout value inside NfsTimeout() when a timeout occurs.

- Make the 'nfs' command print the 'T' character when a timeout occurs. Previously there was no indication that timeouts were occuring.

- Mimic the 'tftpboot' command and when a download fails print "Retry count exceeded; starting again", and restart the download taking the 'netretry' environment variable into account.

---
 net/nfs.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
net/nfs.c +6 -5
index 27395fb..51b17c7 100644
@@ -571,13 +571,14 @@ Interfaces of U-BOOT
 static void
 NfsTimeout (void)
 {
-	if ( NfsTimeoutCount++ < NFS_RETRY_COUNT ) {
+	if ( ++NfsTimeoutCount > NFS_RETRY_COUNT ) {
+		puts ("\nRetry count exceeded; starting again\n");
+		NetStartAgain ();
+	} else {
+		puts("T ");
+		NetSetTimeout (NFS_TIMEOUT, NfsTimeout);
 		NfsSend ();
-		return;
 	}
-	puts ("Timeout\n");
-	NetState = NETLOOP_FAIL;
-	return;
 }
 
 static void
Signature · 1 line
1.6.2.1
#1 lore raw

PATCH 1/1 nfs: NfsTimeout() updates

Dear Peter Tyser,

Quoted 18 lines · In message <[email protected]> you wrote:

From: Evan Samanas <[email protected]>

- NfsTimeout() does not correctly update the NFS timeout value which results in NfsTimeout() only being called once in certain situations. This can result in the 'nfs' command hanging indefinetly. For example, the command:

    nfs 192.168.0.1:/home/user/file

will not exit until ctrl-c is pressed if 192.168.0.1 does not have an NFS server running.

This issue is resolved by reinitializting the NFS timeout value inside NfsTimeout() when a timeout occurs.

- Make the 'nfs' command print the 'T' character when a timeout occurs. Previously there was no indication that timeouts were occuring.

Quoted 6 lines

- Mimic the 'tftpboot' command and when a download fails print "Retry count exceeded; starting again", and restart the download taking the 'netretry' environment variable into account.

Tested on TQM8xxL.

Tested by: Wolfgang Denk <[email protected]>

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I've got a bad feeling about this.
#3 lore raw

PATCH 1/1 nfs: NfsTimeout() updates

In reply to Peter Tyser

Dear Peter Tyser,

Quoted 22 lines · In message <[email protected]> you wrote:

From: Evan Samanas <[email protected]>

- NfsTimeout() does not correctly update the NFS timeout value which results in NfsTimeout() only being called once in certain situations. This can result in the 'nfs' command hanging indefinetly. For example, the command:

    nfs 192.168.0.1:/home/user/file

will not exit until ctrl-c is pressed if 192.168.0.1 does not have an NFS server running.

This issue is resolved by reinitializting the NFS timeout value inside NfsTimeout() when a timeout occurs.

- Make the 'nfs' command print the 'T' character when a timeout occurs. Previously there was no indication that timeouts were occuring.

- Mimic the 'tftpboot' command and when a download fails print "Retry count exceeded; starting again", and restart the download taking the 'netretry' environment variable into account.

Quoted 5 lines
---
 net/nfs.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

Applied, thanks.

Ben, I hope ... etc. :-)

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There's another way to survive.  Mutual trust -- and help.
	-- Kirk, "Day of the Dove", stardate unknown