Fix access check for root execute perm

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Flags needs to be collected under lock before checking;
Otherwise a race with other close+open could change the fd
mode and may result in an write failure with EACCESS.

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Revert "Create separate lru gc thread when fd caching is disabled."

This reverts commit dc1da9986843ffd2962c3b0612a9654dfa0df094.

Investigation proved that the previous commit is needed.
Though we don't need to process fds if the cache_fds are disabled,
but moving cached entries from LRU1 to LRU2, are needed to recycle
them properly.

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Make sure that we process LRU1 and LRU2 cache even if fd cache is
disabled.

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Set extremis flag in lru_thread only if fd cache is enabled.

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Temporary change to get around invalidate problem until complete changes coded and tested.
Replace DupReq_Expiration parameter

Looks like DupReq_Expiration was accidentally removed when
adding DRC config params.  This patch puts the DupReq_Expiration
back

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
GRANTED_RES does not have file handle, so no check for export or credential.
Get rid of some dead code

test_idmapper.c is never invoked and tests a defunct hash function.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
FSAL_GPFS no longer uses FSAL_UP parms in config, ignore them

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Add strmaxcpy and strmaxcat inline functions

These functions check if the destination buffer has room, and
if so, copy or concatenate the string and return 0. The destination
will be null terminated (and these functions assume the source
strings are null terminated also).

If there isn't enough room, the destination is unchanged and
the functions return -1.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Add space for null char in MAXNAMELEN/FSAL_MAX_NAME_LEN buffers

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Explicitly use NFS4_VERIFIER_SIZE instead of "8"

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Replace strncpy with memcpy for copying NFS4 open verifier

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Cleanup string length issues in log_functions.c

Also use gsh_malloc instead of malloc in normal path.

This patch does not touch get_debug_info().

Also remove unused GetNameFunction.

Also remove log_vnsprintf

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
In cache_inode_avl only MurmurHash3_x64_128 the length of names

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Add some cache inode debug

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Fixes in cache_inode_readdir

cache_inode_operate_cached_dirent is ok if dirent doesn't exist
and request was CACHE_INODE_DIRENT_OP_REMOVE.

In cache_inode_readdir, while looping, must always go to next
dirent.

Also, make temp copy of name before calling cache_inode_lookup_impl.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Add cache_inode_lookup_weakref to readdir

cache_inode_lookup_weakref() is used to lookup a cache inode entry
when the weakref in the dirent is broken.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Only cache_inode_put(pentry_lookup) if pentry_lookup not NULL

Signed-off-by: Frank Filz <ffilz@us.ibm.com>