feature/snapshot : Interface to delete all snapshots belonging
to a system as-well-as to a particular volume.

Problem :
With the current design we can only delete a single snapshot.
And the deletion of volume which contains snapshot is not allowed.
Because of that user might be forced to delete all the snapshots
manually before he is allowed to delete a volume.

Solution:
Following is the interface with which user can delete
all the snapshots of a system or belonging to a particular volume.

        Syntax : gluster snapshot delete all

        *To delete all the snapshots present in a system

        Syntax : gluster snapshot delete volume <volname>

        *To deletes all the snapshot present in a volume specified.

========================================================================
Sample Output:

Case 1 : Deleting a single snapshot.
[root@snapshot-24 glusterfs]# gluster snapshot delete snap1
Deleting snap will erase all the information about the snap. Do you still want to continue? (y/n) y
snapshot delete: snap1: snap removed successfully

-----------------------------------------------------------------
Case 2 : Deleting all the snapshots in a Volume.
[root@snapshot-24 glusterfs]# gluster snapshot delete volume vol1
Volume (vol1) contains 9 snapshot(s).
Do you still want to continue and delete them?  (y/n) y
snapshot delete: snap2: snap removed successfully
snapshot delete: snap3: snap removed successfully
snapshot delete: snap4: snap removed successfully
snapshot delete: snap5: snap removed successfully
.
.
.

-----------------------------------------------------------------
Case 3 : Deleting all the snapshots in a system.
[root@snapshot-24 glusterfs]# gluster snapshot delete all
System contains 4 snapshot(s).
Do you still want to continue and delete them?  (y/n) y
snapshot delete: snap7: snap removed successfully
snapshot delete: snap8: snap removed successfully
snapshot delete: snap9: snap removed successfully
snapshot delete: snap10: snap removed successfully
========================================================================

Change-Id: Ifec8e128ab2011cbbba208376b9c92cfbe7d8d71
BUG: 1112613
Signed-off-by: Sachin Pandit <spandit@redhat.com>
Reviewed-on: http://review.gluster.org/8162
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
Attempt to fix cmockery2 build

The current code assumes cmockery2 is installed in default paths.
Use PKG_MODULES_CHECK to find it using pkg-config if it is not. If
not found by pkg-config, try AC_CHECK_LIB.

There are also some build flag adjustement so that local overrides
do not loose the required -I flags.

This includes and enhance http://review.gluster.org/8340/

BUG: 764655
Change-Id: Ide9f77d1e70afe3c1c5c57ae2b93127af6a425f9
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8365
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
doc: How to generate and read statedump

Thanks to Poornima G's help with iobuf
Section explanation.

Change-Id: I17737fdbd1f402914f7e67fb4047f5c26ea5c36c
BUG: 1118309
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/8288
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
Reviewed-by: Prashanth Pai <ppai@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
rpc,glusterd: Set ret to 0 after call to rpc_clnt_submit()

This is to guard against a double STACK_DESTROY in the event that
rpc_clnt_submit() failed and returned -1 anytime after sending the
request over the wire. in which case the stack could be destroyed
twice: once in the callback function of the request and once in
the error codepath of some of the callers of glusterd_submit_request().
This bug was introduced in http://review.gluster.org/#/c/8257/

Change-Id: I18a345db6eafc62ba312743201ced7d3f8697622
BUG: 1116243
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/8301
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Allow gluster to be used with linux automounter

Added (ignored) -n option to mount.glusterfs command

Change-Id: I9209da215d38507cd9d01b1e9af4aecff4414f83
BUG: 1123004
Signed-off-by: Anders Blomdell <anders.blomdell@control.lth.se>
Reviewed-on: http://review.gluster.org/8373
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
tests/bug-961307.t: echo output string in case of failure for easy debug.

Change-Id: I5bb5d7f2d9380da3247588e8eff10b559e17ff3f
BUG: 1122533
Signed-off-by: Kotresh H R <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/8362
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Regression test portability: hostname

The --fqdn option to hostname is Linux only
This is resubmission of the same patch. I assume the regression test
is a test bug

BUG: 764655
Change-Id: I6437124186435f10d1ee6a847e2593554d633716
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8282
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Harshavardhana <harsha@harshavardhana.net>
Regression test portability: ps

ps aux is truncated to the terminal width on NetBSD, Use ps auxww to
avoid that

BUG: 764655
Change-Id: I28a2fc23e2823dd6524a72da30111b86fc4bfa7b
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8281
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Harshavardhana <harsha@harshavardhana.net>
libgfapi : glfs_create()/glfs_h_creat()/glfs_open()/glfs_h_open() should set
fd->flags before syncop_open()

glfs_create() and glfs_open() do not set fd->flags before calling syncop_open().
This patch addresses this problem and ensure the flags are set in fd before
invoking syncop_open()

Change-Id: I9ef3243b1de610e1dd1a3e37b66fc2f763a865f9
BUG: 1096047
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/7999
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
Reviewed-by: Anand Avati <avati@redhat.com>
doc : man page and admin-guide for newly introduced snapshot delete option.

Change-Id: Iab5e7f63d673a2040e8d83ab7280121ff468836e
BUG: 1112613
Signed-off-by: Sachin Pandit <spandit@redhat.com>
Reviewed-on: http://review.gluster.org/8378
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
storage/posix: removing deleting entries in case of creation failures

The code is not atomic enough to not to delete a dentry created by a
prallel dentry creation operation.

Change-Id: I9bd6d2aa9e7a1c0688c0a937b02a4b4f56d7aa3d
BUG: 1117851
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-on: http://review.gluster.org/8327
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
dht: fix rename race

Additional check to check if we created the linkto
file before deleting it in the rename cleanup function

Change-Id: I919cd7cb24f948ba4917eb9cf50d5169bb730a67
BUG: 1117851
Signed-off-by: Nithya Balachandran <nbalacha@redhat.com>
Reviewed-on: http://review.gluster.org/8338
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
cli : glusterd getspec usage correction

gluster system getspec asks to input volume-id instead of volume name

Change-Id: I0baef9c937fc8948477aa65c8f98916b28c1e484
BUG: 1121870
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/8342
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
glusterd/snapshot: Proper err msg for snapshot create command

problem: Snapshot command fails if one or more bricks are not thinly
provisioned. But the error message is a generic error message which
is confusing to the user.

fix: Provide correct error message in case of failure.

Change-Id: Iad247f966423a8f73ef6da57cab7ed6cddc05861
BUG: 1123646
Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-on: http://review.gluster.org/8377
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
glusterd: Error msg for snapshot status for no existing snaps
should be aligned with error messages of info and list

When a snapshot operation like status, info, list
performed on a non-existing snapshot.
For Status error message is displayed as 'Snap not found'
For List and Info error message is displayed as 'Snapshot does not exist'
Have the consistant error message all the places

Change-Id: I7b241217dba62fda844481731a6858e4ecb12897
BUG: 1119641
Signed-off-by: Vijaikumar M <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/8309
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
cluster/afr: Improve inodelk/entrylk failure log messages

Change-Id: Ie792875546b4f8e11ebf870a6e63aaf5cb221976
BUG: 1121920
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/8344
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
nfs/drc: Fix memory corruptions

* A wrong memory allocator was used to (de)allocate nodes (not data in
them) of rb tree. This patch uses default allocator, since that suits
our purpose.
* Fix reference counting of client, though hitting the codepath
containing this bug is highly unlikely.

Change-Id: I7692097351d6e54288fee01da5af18e761fd0e8c
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
BUG: 1067256
Reviewed-on: http://review.gluster.org/7816
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Make RPM's with current git tag

1. clear autom4te.cache
2. autogen.sh
3. configure --with-previous-options

Change-Id: I90c1820d22207d18b1bb367444b21918467baea5
BUG: 1117921
Signed-off-by: Anders Blomdell <anders.blomdell@control.lth.se>
Reviewed-on: http://review.gluster.org/8293
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
build: fix compile issue in unittest on EPEL-5

When building the current master branch on EPEL-5, the following error
is observed:

      CC     dht_layout_unittest-dht_layout_mock.o
    unittest/dht_layout_mock.c:77:2: error: no newline at end of file
    make[5]: *** [dht_layout_unittest-dht_layout_mock.o] Error 1
    make[5]: *** Waiting for unfinished jobs....

EPEL-5 has this gcc:

    $ gcc --version
    gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-54)

The fix is simple enough, dht_layout_unittest-dht_layout_mock.c should
have a line ending.

BUG: 1124858
Change-Id: I8ca7a1699fd1c35694073b9577f94ae525854713
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/8392
Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com>
Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Luis Pabon <lpabon@redhat.com>
Regression test portability: run-test.sh

- Check for pidof(8) presence. It may not be present on non Linux systems
- Add a -f flag to run-tests.sh to bypass utility presence checks

Submit again because of spurious regression test failure

BUG: 764655
Change-Id: Iee6282c686c63a01808543054f8e5a3b5b79fca2
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8279
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Harshavardhana <harsha@harshavardhana.net>