libnfs.c: Fix autoreconnect
[deb_libnfs.git] / lib / libnfs.c
index 41b8a2b35f01ea0b9a15cd0a575b7009476fa09d..67c3c85ef38ed8bbaccf8a9255eff7f01b9fa789 100644 (file)
@@ -77,7 +77,7 @@
 #include "libnfs-raw-portmap.h"
 #include "libnfs-private.h"
 
-#define MAX_DIR_CACHE 1024
+#define MAX_DIR_CACHE 128
 
 struct nfsdir {
        struct nfs_fh3 fh;
@@ -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);
 }