Clean up EXCHANGE_ID and get rid of macros

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
Get rid of static buffer in client_record_t

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
[Travis-CI] Add support for integration with travis-ci.

Travis - CI is a free hosted continuous integration platform.
This commit adds the integration support to get 'next' branch built automatically on each commit.

Signed-off-by: Sachin Bhamare <sbhamare@panasas.com>
Remove comments around ifdef USE_DBUS_STATS

leftovers from Cmake debugging

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Simplify nfs_ParseConfLine and have it's users handle buffer sizes

Instead of allocating memory all over the place, considering the
input string to nfs_ParseConfLine is modified to null terminate
every token, just return pointers to those sub-strings.

We don't to the following:
Also, length check each token if requested (some callers benefit
from this, other callers don't bother since they aren't copying
the tokens into another string buffer).

manual cherry pick of f78da371335c with cleanup of token parser to use
strings functions instead of our own loops.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Signed-off-by: Jim Lieb <jlieb@panasas.com>
Don't compare client address in EXCHANGE_ID

This interferes with both trunking and reconnection after a change in
address.

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
Check state as well as lease expiry on co_owner collision

This improves conformance with RFC 5661 and closes a @todo item.

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
Change the return type of valid_lease to bool

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
Set EXCHGID4_FLAG_CONFIRMED_R on confirmed ID

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
Add pNFS flags to owner and use a better hash

RFC 5661 says that servers are allowed (but not required) to treat
identical co_owner values sent with different pNFS flags in
EXCHANGE_ID as describing different owners.  The Linux client,
however, responds to being given a known clientid when connecting to a
DS that is colocated on an MDS by calling DESTROY_CLIENTID and
re-exchanging.

This is a particularly aggressive way not to support trunking.

Also switch to using CityHash for co_owner values rather than a
moddy-loopy-sum over all the bytes.

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
Merge remote-tracking branch 'linuxbox2/next' into merge_next
Extend interface for Ganesha 2.0 recovery using dbus interface.

I believe that this interface covers all the needs from the 1.5 version. It is a
python script that takes event and IP or node-id as input. The only difference is
that if multiple IP or node-id needs to be taken over than the script should be
called multiple times, once for each IP. All events will put Ganesha in grace period.
In the case of EVEN_RELEASE_IP it will release all NLM locks for this IP, for now all
NLM locks are released. In the case of EVENT_TAKE_IP or EVENT_TAKE_NODEID it will read
in the NFSv4 client-id for the given IP or node-id.
(cherry picked from commit 39e3e051e98af2f44bd48368b349dbdbb3deca5e)

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Merge remote-tracking branch 'sachin/travis' into merge_next
Fix fsal_obj leak in cache_inode_lookupp_impl()

cache_inode_lookupp_impl() used to first call FSAL lookup() which creates a
fsal_obj, but then used cache_inode_get() with the parent key from the object
to get a cache entry. This caused a leak of the fsal_obj created by the
lookup() call which was never released.
A simpler and safer approach is to call cache_inode_new_entry() directly using
the fsal_obj created by lookup().

Signed-off-by: Amit Dror <amitd@infinidat.com>
(cherry picked from commit 8572b25e410f89b1dadae75c70edf0c551183d26)

Signed-off-by: Jim Lieb <jlieb@panasas.com>
9P/RDMA: fixed bad lock management in 9P/RDMA callbacks.
(cherry picked from commit 1a45f123588017bf05975d05ff807fa5a1009243)

Signed-off-by: Jim Lieb <jlieb@panasas.com>
RPM: cleaner mansagement of configuration file

Tags like %config and %config(noreplace) are now used.

(cherry picked from commit c4ccfedffc13af1be407e07455dbc9a76682fffb)

Signed-off-by: Jim Lieb <jlieb@panasas.com>
NFS: a bug fix provided by Ming Chen (v.mingchen@gmail.com)
(cherry picked from commit 6b93f6f901520d6edb065bc8f46017e516eeedfc)

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Fixed missed part of cache_inode_check_setattr_perms port

Problem was/is in 8fd875c4d112d5876

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