From f91c16b8e28daa725a11fea1b011a35e3c5b6721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Fri, 7 Feb 2014 22:28:05 +0100 Subject: [PATCH] nfs: skip over stale rpc packets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Sascha Hauer --- fs/nfs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/nfs.c b/fs/nfs.c index 6582bae7d..76d8c0595 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 ||