Add CMake rules for thread-sanitizer

thread-sanitizer is a data race detector introduced into GCC from GCC 4.8.  The
patch has been tested on CentOS 6.4 using CMake 2.8.10.2 and GCC 4.8.2.

Reviewed-by: Jim Lieb <jlieb@panasas.com>
Tested-by: Ming Chen <v.mingchen@gmail.com>
Signed-off-by: Ming Chen <v.mingchen@gmail.com>
Fix data race caused by open_fd_count

Wrap all open_fd_count accesses with atomic operators.

Reviewed-by: Jim Lieb <jlieb@panasas.com>
Signed-off-by: Ming Chen <v.mingchen@gmail.com>
Fix a trivial data race in xdr_nfs_argop4()

slhd is no more than a write scratch buffer.  It does not hurt much to make it
non-static, but this make tsan happier.

Signed-off-by: Ming Chen <v.mingchen@gmail.com>
Fix a trivial data race in put_gsh_client()

Signed-off-by: Ming Chen <v.mingchen@gmail.com>
Fix a deadlock regarding free_contexts in pxy_compoundv4_execute()

The "if" test introduced a deadlock.  Consider there are 2 items (i.e., x = 2)
in the list of free_contexts, then the following execution order will deadlock:

            T1            T2            T3            T4            T5
            (1)           (2)           (3)           (4)           (5)
          x == 2        x === 1       x == 0        x == 0        x == 0
acquire   x = 1         x = 0         block         block         block

                                        (8)
                                      unblock
                                      x == 2
                                      x = 1 (acquire)

            (6)         (7)            (9)
          x == 0      x == 1          x == 1
          signal      no signal       no signal
release   x = 1       x = 2           x = 2

Thread T4 and T5 will wait forever.

Also, use a separate lock "context_lock", instead of the global "listlock", to
protect the "free_contexts" list.

Signed-off-by: Ming Chen <v.mingchen@gmail.com>
Updated README file for FSAL_GLUSTER

The README replaces the old config file with the new format.
A sample export file has also been added.
Issue: Ganesha dumps core during a pynfs test (RD2) when started in DEBUG log level.

Fix:
The sequence id is written into a string str, whose size was 31 bytes.The
values of stateid->seqid vary from 1,2 to the largest number possible,
4294967295. The size of the string str has to be 36 bytes long (along with the ':')
to accommodate the largest possible stateid->seqid.
Increasing the string size to fix the issue.
Coverage: Adds option "COVERAGE=ON|OFF" to add "--coverage" flag for gcc

This commits add the "COVERAGE" option to cmake.
If set ON, code will be compiled with "--coverage".
At runtime, ganesha will prouce *.gcda file (if shutdown gently).
Those files can be used as input to gcov or lcov to produce coverage reports.

Signed-off-by: Philippe DENIEL <philippe.deniel@cea.fr>
Coverage: adding a "lcov" target

This commit add a "lcov" target. This target will exist only
is COVERAGE=ON and if lcov as been installed on the machine.

Signed-off-by: Philippe DENIEL <philippe.deniel@cea.fr>
FSAL_LUSTRE: removes unused field 'inode' in fsal_handle.

Signed-off-by: Philippe DENIEL <philippe.deniel@cea.fr>
Don't confuse the BUILDROOT with the final install location

This is a bit tricky.  We must build with the installed files thinking
they are in CMAKE_INSTALL_PREFIX/* but rpmbuild does the install into
a buildroot that is then slurped up into the package as if it is starting
at '/'.  CMAKE_INSTALL_PREFIX is for configure/build time and DESTDIR is
for rpmbuilds %install time.

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Fix cut and one too many pastes in nfs-ganesha.spec-in.cmake

Duplicate package defs for CEPH

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Disable SHOOK fsal if LUSTRE fsal is not enabled.

One needs the other.

Signed-off-by: Jim Lieb <jlieb@panasas.com>
FSAL_GLUSTER: Multi-volume and v3 subdir exports bug-fix.

To enable multi-volume exports and uniquely identify each volume's root file-handle,
have included APIs to fetch volume's UUID from libgfapi and embed it in the file-handle.

And regarding v3 subdir mounts, earlier we were returning always the root filehandle even
if the mount-path is any sub-dir path of the exported volume.
To fix that I have included checks to detect such cases and pass the relative path of
the mounted subdir to the libgfapi before fetching the filehandle.

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Fix broken IOstat class init

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Rename shutdown.py to ganesha-admin

In prep for consolidating all the admin scripts for command line..
Also, The name is taken in that 'shutdown' doesn't shut down ganesha,
it shuts down the system...

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Consolidate shutdown, reload, and grace admin into ganesha-admin script

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Refactor PyQt GUI related classes into the Ganesha module

Separate the DBus classes from the PyQt UI classes by adding the
QtUI sub.

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Add support for setup.py for admin tools

Builds and installs the Python DBus admin scripts.

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Add GPL banner to ganeshactl python code

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