Debug around pthread_rwlock.*

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Fix in nfs4_op_open to properly handle parent entry's refcount.
Incorrect refcount handling here caused another thread reap parent
entries before cache_inode_getattr was invoked.
Make sure cache_inode_lru_get tries out lanes in different order
while reaping.

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
IdMapper - process numeric UID/GID in NFS4

As the source of last resort try checking if owner and owner_group in
NFSv4 attributes is purely numeric value. If the check passes then assume
that ID is good and add it to the in-core cache - this deals with servers
which return IDs in form 17@myhost.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
IdMapper - fix stack overrun

Use correctly sized local variables which are passed into
idmap_get - that function expects a pointer to long and will
clobber stack if passed something smaller.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
More name2gid/uid fixes for strict compile errors

change declarations to use stddef.h typedefs.

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Fix 32/64 bit portability in idmapper

Uids and Gids are unsigned 32 values. Fix conversions to use stddef.h
on the outside and uint32_t on the inside.  This is portable across all
platforms.

Signed-off-by: Jim Lieb <jlieb@panasas.com>

Conflicts:

	src/IdMapper/idmapper.c
	src/IdMapper/idmapper_cache.c
	src/include/nfs_core.h
More uid_t/gid_t fixups

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Utilize anonymous uid and gid from export perms for idmapping failures

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Clean up some export cruft

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Fix some issues in MOUNT

Tag didn't work (tried to compare "/" terminated path to Tag
If no export was found, didn't actually report error
A couple minor issues with using "/" terminated path in log

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Increase number of pseudo fs nodes to 2048 and check limits

Also clean up some dead code.

The limit of 100 pseudo fs nodes is rather insufficient for 1000 exports...

To make it somewhat sane to test, I increased the number of path elements in
a pseudo path to 128.

Moved set up of pseudo fs until after creating root entries. This assures
that the pseudo fs only contains valid exports (previously, an export for
a path that didn't actually exist in the FSAL would be instantiated in the
pseudo fs, and then the export would have been discarded, leaving a dangling
pointer for someone to trip on).

Also improved the logging within the pseudo fs.

Also check pseudofs_id in pseudo fs handle before dereferencing array.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Improve GPFS errors in building export context

Make the check if the GPFS file system exists more
stringent. Export path must actually be a sub-directory
under the GPFS mount point or the mount point itself.
Check for \0 or / after the portion of the export path
that is equal to the mount point. So, for example, if
mount point is /ibm/fs0:

/ibm/fs0 is a valid export path
/ibm/fs0/ is a valid export path
/ibm/fs01 is not a match
/ibm/fs0/dir is a valid export path

Cleanly report that the exported path doesn't exist.

Cleanly report that the exported path is not a directory.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Make fsal_up_event_pool global, remove event_pool_lock, do init earlier

Also declare process_event in header file for future use.

Also move init of event pool and event queue to nfs_Init_FSAL_UP.

Call nfs_Init_FSAL_UP() before nfs_export_create_root_entry().

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Add some infrastructure for GPFS to manage FSAL UP Threads

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

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

FSAL UP threads will be managed by FSALs, generally created
during FSAL_BuildExportContext if the FSAL needs more than one.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Clean some unused stuff from FSAL UP

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Make use of GPFSFSAL_UP_Thread

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Remove obsolete code from GPFSFSAL_UP_GetEvents

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