Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 23475d66 authored by Chuck Lever's avatar Chuck Lever Committed by Trond Myklebust
Browse files

[PATCH] RPC: Report connection errors properly when mounting with "soft"



 Fix up xprt_connect_status: the soft timeout logic was clobbering tk_status,
 so TCP connect errors were not properly reported on soft mounts.

 Test-plan:
 Destructive testing (unplugging the network temporarily).  Connectathon
 with UDP and TCP.

 Version: Thu, 11 Aug 2005 16:01:28 -0400

 Signed-off-by: default avatarChuck Lever <cel@netapp.com>
 Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 9aa48b7e
Loading
Loading
Loading
Loading
+18 −9
Original line number Original line Diff line number Diff line
@@ -592,24 +592,33 @@ xprt_connect_status(struct rpc_task *task)
		return;
		return;
	}
	}


	/* if soft mounted, just cause this RPC to fail */
	if (RPC_IS_SOFT(task))
		task->tk_status = -EIO;

	switch (task->tk_status) {
	switch (task->tk_status) {
	case -ECONNREFUSED:
	case -ECONNREFUSED:
	case -ECONNRESET:
	case -ECONNRESET:
		dprintk("RPC: %4d xprt_connect_status: server %s refused connection\n",
				task->tk_pid, task->tk_client->cl_server);
		break;
	case -ENOTCONN:
	case -ENOTCONN:
		return;
		dprintk("RPC: %4d xprt_connect_status: connection broken\n",
				task->tk_pid);
		break;
	case -ETIMEDOUT:
	case -ETIMEDOUT:
		dprintk("RPC: %4d xprt_connect_status: timed out\n",
		dprintk("RPC: %4d xprt_connect_status: connect attempt timed out\n",
				task->tk_pid);
				task->tk_pid);
		break;
		break;
	default:
	default:
		printk(KERN_ERR "RPC: error %d connecting to server %s\n",
		dprintk("RPC: %4d xprt_connect_status: error %d connecting to server %s\n",
				-task->tk_status, task->tk_client->cl_server);
				task->tk_pid, -task->tk_status, task->tk_client->cl_server);
		xprt_release_write(xprt, task);
		task->tk_status = -EIO;
		return;
	}
	}

	/* if soft mounted, just cause this RPC to fail */
	if (RPC_IS_SOFT(task)) {
		xprt_release_write(xprt, task);
		xprt_release_write(xprt, task);
		task->tk_status = -EIO;
	}
}
}


/*
/*