Skip to content
Permalink
Browse files

Make rpc_disconnect() a no-op if the session is already disconnected

This addresses a bug causing a segfault if we destroy the nfs context/
disconnect the session while the mount_8_cb callbacks for checking the
filehandle for nested mountpoints are still in flight.

Issue found and reported by doktorstick

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
  • Loading branch information...
sahlberg committed Jul 5, 2016
1 parent 28e01e6 commit fac3a95453c392a01f8ec18c94368afa92564ba7
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/socket.c
@@ -583,6 +583,10 @@ int rpc_disconnect(struct rpc_context *rpc, const char *error)
{
assert(rpc->magic == RPC_CONTEXT_MAGIC);

/* Do not re-disconnect if we are already disconnected */
if (!rpc->is_connected) {
return 0;
}
rpc_unset_autoreconnect(rpc);

if (rpc->fd != -1) {

0 comments on commit fac3a95

Please sign in to comment.
You can’t perform that action at this time.