diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2014-02-07 22:28:05 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-02-10 09:02:20 +0100 |
commit | f91c16b8e28daa725a11fea1b011a35e3c5b6721 (patch) | |
tree | 7c1fdbc279ec1490c515fcb51d649ef8e13d4583 /fs/nfs.c | |
parent | e6745134480680e2163dfe16cb5798bcd20e8ef4 (diff) | |
download | barebox-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/nfs.c')
-rw-r--r-- | fs/nfs.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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 || |