From 28ee9de2e458640310b7a41ac6c12d7d23ff2c6a Mon Sep 17 00:00:00 2001 From: Ross Lagerwall Date: Sat, 19 Jul 2014 11:32:40 +0100 Subject: [PATCH] libnfs.c: Fix autoreconnect Since rpc_connect_async sets autoreconnect to 0, turn autoreconnect on after the connection has completed, not before. This fixes #76. Signed-off-by: Ross Lagerwall --- lib/libnfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libnfs.c b/lib/libnfs.c index 94f03cb..67c3c85 100644 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -771,6 +771,9 @@ static void nfs_mount_8_cb(struct rpc_context *rpc, int status, void *command_da return; } + /* NFS TCP connections we want to autoreconnect after sessions are torn down (due to inactivity or error) */ + rpc_set_autoreconnect(rpc); + args.fsroot = nfs->rootfh; if (rpc_nfs3_fsinfo_async(rpc, nfs_mount_9_cb, &args, data) != 0) { data->cb(-ENOMEM, nfs, command_data, data->private_data); @@ -823,9 +826,6 @@ static void nfs_mount_6_cb(struct rpc_context *rpc, int status, void *command_da free_nfs_cb_data(data); return; } - - /* NFS TCP connections we want to autoreconnect after sessions are torn down (due to inactivity or error) */ - rpc_set_autoreconnect(rpc); } -- 2.34.1