From 9dd4708aed9832b0880148efdd4cab0248e8cfc0 Mon Sep 17 00:00:00 2001 From: Olga Kornievskaia Date: Mon, 30 Apr 2012 11:57:34 -0400 Subject: [PATCH] leaving one max_component len constant both NFS41_MAX_COMPONENT_SIZE and NFS41_MAX_COMPONENT_LEN represented the same value. --- daemon/name_cache.c | 4 ++-- daemon/nfs41_const.h | 2 -- daemon/readdir.c | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/daemon/name_cache.c b/daemon/name_cache.c index 1ca83e0..8320746 100644 --- a/daemon/name_cache.c +++ b/daemon/name_cache.c @@ -360,7 +360,7 @@ static void copy_attrs( /* name cache */ RB_HEAD(name_tree, name_cache_entry); struct name_cache_entry { - char component[NFS41_MAX_COMPONENT_SIZE]; + char component[NFS41_MAX_COMPONENT_LEN]; nfs41_fh fh; RB_ENTRY(name_cache_entry) rbnode; struct name_tree rbchildren; @@ -608,7 +608,7 @@ static struct name_cache_entry* name_cache_search( dprintf(NCLVL2, "--> name_cache_search('%.*s' under '%s')\n", component->len, component->name, parent->component); - StringCchCopyNA(tmp.component, NFS41_MAX_COMPONENT_SIZE, + StringCchCopyNA(tmp.component, NFS41_MAX_COMPONENT_LEN, component->name, component->len); tmp.component_len = component->len; diff --git a/daemon/nfs41_const.h b/daemon/nfs41_const.h index 874623f..9b7a870 100644 --- a/daemon/nfs41_const.h +++ b/daemon/nfs41_const.h @@ -39,8 +39,6 @@ #define NFS41_MAX_SERVER_CACHE 1024 #define NFS41_MAX_RPC_REQS 128 -#define NFS41_MAX_COMPONENT_SIZE 64 - #define UPCALL_BUF_SIZE 2048 /* MaximumComponentNameLength reported for FileFsAttributeInformation */ diff --git a/daemon/readdir.c b/daemon/readdir.c index b632d8b..85af2c9 100644 --- a/daemon/readdir.c +++ b/daemon/readdir.c @@ -459,7 +459,7 @@ static int handle_readdir(nfs41_upcall *upcall) bool_t eof; /* make sure we allocate enough space for one nfs41_readdir_entry */ const uint32_t max_buf_len = max(args->buf_len, - sizeof(nfs41_readdir_entry) + NFS41_MAX_COMPONENT_SIZE); + sizeof(nfs41_readdir_entry) + NFS41_MAX_COMPONENT_LEN); dprintf(1, "-> handle_nfs41_dirquery(%s,%d,%d,%d)\n", args->filter, args->initial, args->restart, args->single);