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>libnfs-4.0.0-vitalif
parent
28e01e67b1
commit
fac3a95453
|
@ -583,6 +583,10 @@ int rpc_disconnect(struct rpc_context *rpc, const char *error)
|
||||||
{
|
{
|
||||||
assert(rpc->magic == RPC_CONTEXT_MAGIC);
|
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);
|
rpc_unset_autoreconnect(rpc);
|
||||||
|
|
||||||
if (rpc->fd != -1) {
|
if (rpc->fd != -1) {
|
||||||
|
|
Loading…
Reference in New Issue