diff --git a/fs/nfs/nfs_util.c b/fs/nfs/nfs_util.c index 452d36cfc9..d7137f99b5 100644 --- a/fs/nfs/nfs_util.c +++ b/fs/nfs/nfs_util.c @@ -128,7 +128,32 @@ int nfs_request(FAR struct nfsmount *nmp, int procnum, if (error != 0) { ferr("ERROR: rpcclnt_request failed: %d\n", error); - return error; + + if (error != -ENOTCONN) + { + return error; + } + + /* Reconnect */ + + finfo("Reconnect due to timeout \n"); + + error = rpcclnt_connect(nmp->nm_rpcclnt); + + if (error != 0) + { + return error; + } + + /* Send the request again */ + + error = rpcclnt_request(clnt, procnum, NFS_PROG, NFS_VER3, + request, reqlen, response, resplen); + + if (error != 0) + { + return error; + } } memcpy(&replyh, response, sizeof(struct nfs_reply_header));