fix refcount problems in v4 OPs.
few more refcount problems in V4 code.
more refcount issues in V4. and fix to use new "put" prototype.
fix the define for OPENHANDLE_READLINK_BY_FH
Divide invalidate up call into two steps; Clear bits in the up thread
context and deffer the close to separate thread.

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Strict compile fix by: Srikrishan Malik <srimalik@in.ibm.com>
Add debug to capture open_fd_count when EMFILE reported

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Remove export_buddy_stats from conf file to fix:
ERROR: Unknown or unsettable key: export_buddy_stats (item GPFS)

Signed-off-by: Srikrishan Malik <srimalik@in.ibm.com>
re-introduce stable storage for client ids to perform proper V4 recovery.
Add fsal_op_context parameter to FSAL_write

In order for the write to account for User's quota we need the
user information in FSAL_write. Currently FSAL_write do not
have the user information.

Add fsal_op_context_t as a parameter to FSAL_write to help with
quota related operations.

Signed-Off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Add fsuid/fsgid around the write operation

Make sure the users uid/gid is accounted for the write operation
performed.

Signed-Off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Add fsuid/fsgid around the create operation

Make sure the user's uid/gid is accounted for the create operation
performed.

Now that we are setting the fsuid/fsgid to the real user's uid/gid, we do
not have to jump hoops to make sure the setgid bit in the parent directory
is honored. So, get rid of that code.

Signed-Off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Make sure the user's uid/gid is accounted for the mknod operation
performed.

Now that we are setting the fsuid/fsgid to the real user's uid/gid, we do
not have to jump hoops to make sure the setgid bit in the parent directory
is honored. So, get rid of that code.

Signed-Off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
setfsuid/setfsgid changes for mkdir.

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Add fsuid/fsgid around the setattr; This will cover truncate too.

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
NFSv3 - undo cut'n'paste errors in mknod and mkdir

nfs3_Mknod and nfs_Mkdir had lot of duplicate code added
during cache inode rewrite.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
NFS - once again restore the processing of FATTR4_TIME_*_SET

Modifying LastOffset without setting op_attr_success creates a discrepancy
between bitmap and the attribute values - some servers (Linux kernel NFSD
in particular) reject XDR calls which use such encoding to BADXDR error.

The change in 3dbb63a29579854d0b870a58d4df64bb9b35ee74 got lost
during inode cache rewrite.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
XFS FSAL - strict compile

How many times does one need to change the prototype
for check_quota to make it stick?

Signed-off-by: Max Matveev <makc@gmx.co.uk>
NFS - initialize user credentials properly

When dealing with requests which use AUTH_NONE make sure that
user_credentials are initialized properly: treat AUTH_NONE requests
as anonymous.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
NFSv3 - don't leak memory on read

If the offset in the read request is past the end of the file
or if there is an error then make sure that the buffer allocated
to receive the data is freed - post-op free does not free the
memory if read did not return any data.

Signed-off-by: Max Matveev <makc@gmx.co.uk>
NFSv4 - respect array boundaries in bitmap4

The caller of nfs4_list_to_bitmap4() sets the bitmap size
to the maximum value: make sure we respect this value.

In the ideal world nfs4_list_to_bitmap4 would return
an error if it cannot convert the list to bitmap because
the array provided by the caller is too small but nobody is
checking the return value now, so just print a whiny messages
and hope it will get noticed - it's better then crapping over
someone's stack anyway.

Signed-off-by: Max Matveev <makc@gmx.co.uk>