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.
Using handle_size bytes gpfs_fsal_handle in GPFSFSAL_handlecmp and FSAL_Handle_to_RBTIndex/FSAL_Handle_to_HashIndex
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>
Make sure all strings properly handled in fsal_strings.c

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Pass in_str_maxlen=0 to FSAL_str2name/FSAL_str2path if str is null term

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Replace strncpy and strlcpy with strmaxcpy, check overflow and null terminate strings

Also check result of strmaxcpy and report error if overflow
would have occurred.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Reuse p_pdirent[*p_nb_entries].name to get handle for dirent

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