Fix use of current stateid

NFS v4.1 Adds a new special stateid: other=0, seqid=1. This stateid indicates
to use the "current stateid" from the last operation that returned a stateid.

There were two problems, first, CLOSE did not request to allow that stateid
because it was using the wrong flag constants.

Second, when we found a valid current stateid, we did not escape to check
it properly.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Fix PsuedoFS LOOKUPP of root

Root is no longer pseudo_id == 0, so need different root detection.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Fix handling of empty file handle

We should check nfs_fh4_val == NULL to indicate if there is a file handle
buffer or not, not nfs_fh4_len == 0.

That allows us to set nfs_fh4_len = 0 to "empty" the file handle while
leaving the buffer intact.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
NFS v4.1 SECINFO must empty CurrentFH

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
DESTROY_CLIENTID must be only operation

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Fix pNFS file handle size.
Add a file close when done with symlink.
If upcall will ne to close the file make it async cal.
Throw out sessions when clientid is expired.

Also use cid_mutex to protect list of sessions.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Lock xprt for send only if proto is UDP.

The new out-of-line TCP send logic does not require
general serialization.

Also updates ntirpc submodule, since locking change
requires updated ntirpc.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Update ntirpc submodule.

Take xdr_ioq changes.
Take change basing xdr_ioq max segment size (used when
security flavor is RPCSEC_GSS) on Ganesha's configured
MaxRPCSendBufferSize (plus 8K).

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Set new svc_ioq_maxbuf svc_init param.

The value is taken from Ganesha's MaxRPCRecvBufferSize
conf parameter.  Pending a future ntirpc change to use
new/unpublished GSSAPI iov interfaces, this value must
exceed the largest permitted client rsize.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Call ntirpc svc_shutdown before general fridge shutdown.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
TEMP FIX of PYNFS 4.1 SEQ9f

Ganesha currently always caches response so we always provide it even
if client asks not to cache response.

This really should be properly implemented to save us grief.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Improve debug of replayed cache in NFS v4.1

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Set default send/recv size to 1M

If MaxWrite and MaxRead are larger than the recv/send buffer sizes, you
will get mysterious and inexplicable errors under krb5i and krb5p.  This
bumps the send/recv size to match the default of the Linux kernel.

This is not an ideal solution.  If you make the maxread/maxwrite
bigger, it will break again and you'll have to explicitly set the
MaxRPCSendBufferSize and MaxRPCRecvBufferSize variables in the
configuration file.

The long term solution is to get rid of these parameters, make Maxread
and Maxwrite global options, and use them instead.

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
Add warnings for MaxRead/MaxWrite bigger than the RPC Buffer

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
Implement SECINFO_NO_NAME

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Fix LKT4

Start of lock for LOCKT was not initialized from request.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Fix SATT7

If attrlist is empty and attrmask is not empty, we must return NFS4ERR_BADXDR

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>