FSAL_GLUSTER : fixed pynfs failure - RDLK1

This testcase is related to readlink Op. Buffer into which symlink
is read was not NULL terminated. Fixed the same and also made changes
to update the buffer length accordingly.

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Updated spec file and cmake with dbus stat consolidated scripts

Removed deleted scripts from RPM packaging, added new ones.
Added new scripts to cmake build process as well.
Moved glib_dbus_stats.py to proper modules directory and changed import path
in ganesha_stats.py accordingly.

Signed-off-by: Thomas Favre-Bulle <thomas.favre-bulle@bull.net>
Acked-by: Malahal Naineni <malahal@us.ibm.com>
Make Ganesha honor install prefix

Currently, Ganesha has hard-coded locations of some of it's files, most
noteably it's configuration file.  Ganesha can be installed in an
alternate prefix, but it cannot run from that prefix without command
line options.

Change those hard-coded paths to indirect through SYSCONFDIR and
SYSSTATEDIR, so that Ganesha by default runs out of it's prefix.

Because cmake only has one install prefix (CMAKE_INSTALL_PREFIX), it is
difficult to properly install into the root of a filesystem.  To work
around this, Ganesha now by default installs into /usr, with config in
/etc/ganesha, and state in /var/run.  If CMAKE_INSTALL_PREFIX is set,
than it installs into bin/, lib/, etc, share/ and var/ inside that
prefix as normal.  DESTDIR= installs also work correctly in both cases.

Signed-off-by: Daniel Gryniewicz <dang@linuxbox.com>
Tested-by: Niels de Vos <ndevos@redhat.com>
Install a default ganesha.conf file

- Convert the vfs.conf file so it cannot run by default, rather than
  having it export /home
- Install it in the proper prefix location, makeing sure not to clobber
  any existing config file

Signed-off-by: Daniel Gryniewicz <dang@linuxbox.com>
Tested-by: Niels de Vos <ndevos@redhat.com>
Install config_samples into /usr/share/doc

Signed-off-by: Daniel Gryniewicz <dang@linuxbox.com>
Tested-by: Niels de Vos <ndevos@redhat.com>
Fix the spec file to work with the new install prefix

Signed-off-by: Daniel Gryniewicz <dang@linuxbox.com>
Tested-by: Niels de Vos <ndevos@redhat.com>
Merge remote-tracking branch 'skoduri/pynfs' into next

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Merge remote-tracking branch 'tfb/Pull_requests_v2.2-dev-13' into next

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Merge remote-tracking branch 'dang/install-prefix' into next

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Copy addr with actual addrlen in ipstring_to_sockaddr.

Signed-off-by: Rong Zeng <rongzeng@us.ibm.com>
Misc changes to the python script

Fixed multiple errors/issues

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Reviewed-by: Malahal Naineni <malahal@us.ibm.com>
Change LogWarn to LogInfo if uid/gid to name mapping fails.

nfs4_uid_to_name and nfs4_gid_to_name may fail in some environments.
Change the LogWarn to LogInfo to avoid flooding the log file
under default logging configuration.

Ported from 1.5.x branch: 0940ec161849b523b8b9b8cd92fa4650131d2b54

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Reviewed-by: Frank S. Filz <ffilzlnx@mindspring.com>
Don't allow setattr while the server is in grace

Ported from 1.5.x: 311e71dc2101cea6a96fa23744e1f40cb251ab93

If the server is in grace, send NFS4ERR_GRACE to NFS4 clients and
jukebox error to NFSv3 clients.

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Reviewed-by: Frank S. Filz <ffilzlnx@mindspring.com>
Do not check for blocking conflict with a waiting lock for a lock reclaim

Port from 1.5.x:f2262d31b314f4bea6427ca133e93824f46c9c8b

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Network attach/detach may assign the IP to same node

If ip gets assigned to different node:
- Client contacts the new node and the epoch from clientid is going to
  differ from that of the server node's. In this case server returns
  STALE_CLIENT_ID and forces client to reclaim their locks.
- If the ip gets assgined to same node, epochs are going to be same
  and server can't find the clientid in its hash table. This results in
  EXPIRED_CLIENT_ID and forcing client not to reclaim. The fix is for
  this case.

Fix: Keep the clientid in the hash table marking it stale. On the first
  attempt to use that client id, delete it from the hash and return
  STALE_CLIENT_ID, this allows client to reclaim locks after
  establishing new clientid.

Ported from 1.5: e3ec460e5f6ae98deba2590455bc8e8821f61df1
Ported from 1.5: 31b2fde7241a41d3f56929cf8adcc38e351aff28
Ported from 1.5: 7ceca697a1f59c55505ee57a5eb4c0efc93a9f97

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Wait for the lock release during ip move

In the case of ip move the source node may be still releasing
the state that we need to acquire. So let us be little patient
to STATE_LOCK_CONFLICT errors if the lock is a reclaim and we are
in grace and retry it.

Port from 1.5: f63fc49e7d4c76fcaccf8abd1984e77fe16197cb

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Avoid cache_inode_rename deadlock through trylock

Porte from 1.5.x:a4ba14c6b355d98b166749a426ae5ec566160ac1

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Rename deleg_reclaim function to reflect its functionality

Change nfs4_can_deleg_reclaim_prev to  nfs4_check_deleg_reclaim
as the previous name suggests that it is meant for CLAIM_DELEGATE_PREV.

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Removed dead code related to CLAIM_DELEGATE_PREV

Though the removed code is functional, it is half baked and may give
an false impression that the adding this support is just a turn key.
Removing unused code for now. Later, we can start with a clean slate to
add support for CLAIM_DELEGATE_PREV.

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Update nfsv3 op comments to remove export arg.

Signed-off-by: Jeremy Bongio <jbongio@us.ibm.com>
Reviewed-by: Malahal Naineni <malahal@us.ibm.com>
Reviewed-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>