summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2014-02-07 22:28:05 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2014-02-10 09:02:20 +0100
commitf91c16b8e28daa725a11fea1b011a35e3c5b6721 (patch)
tree7c1fdbc279ec1490c515fcb51d649ef8e13d4583 /fs
parente6745134480680e2163dfe16cb5798bcd20e8ef4 (diff)
downloadbarebox-f91c16b8e28daa725a11fea1b011a35e3c5b6721.tar.gz
barebox-f91c16b8e28daa725a11fea1b011a35e3c5b6721.tar.xz
nfs: skip over stale rpc packets
When a former transaction was aborted by hitting Ctrl-C the old reply might still hang in the ethernet controller making all further transactions fail. So just skip over old replies. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/nfs.c b/fs/nfs.c
index 6582bae7db..76d8c0595d 100644
--- a/fs/nfs.c
+++ b/fs/nfs.c
@@ -275,8 +275,13 @@ static int rpc_check_reply(unsigned char *pkt, int rpc_prog, unsigned long rpc_i
memcpy(&rpc, pkt, sizeof(rpc));
- if (ntohl(rpc.id) != rpc_id)
+ if (ntohl(rpc.id) != rpc_id) {
+ if (rpc_id - ntohl(rpc.id) == 1)
+ /* stale packet, wait a bit longer */
+ return 0;
+
return -EINVAL;
+ }
if (rpc.rstatus ||
rpc.verifier ||