218 Commits

Author SHA1 Message Date
Meghana Madhusudhan
368dfd6959 NFS-Ganesha: Volume set option for managing NFS-Ganesha exports.
A dummy translator has been introduced as a place
holder for functions related to managing NFS-Ganesha
exports. A volume set option is introduced to
manage volume level exports.

gluster vol set <volname> ganesha.enable ON/OFF

1. gluster volume set <volname> ganesha.enable ON

It creates the export config file with a unique export ID.
Sends a DBus signal to export this volume dynamically.

2. gluster vol set <volname> ganesha.enable OFF

Unexports the specific volume. Deletes the specfic
config file related to the volume.

This change also removes the handling of the older
keys "nfs-ganesha.enable" and "nfs-ganesha.host"

Change-Id: I8d4a0b542326a6a0c8e4711600b106274d666587
BUG: 1188184
Signed-off-by: Meghana Madhusudhan <mmadhusu@redhat.com>
Reviewed-on: http://review.gluster.org/9585
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
2015-03-18 01:53:22 -07:00
Kaleb S. KEITHLEY
d81182cf69 NFS-Ganesha: Install scripts, config files, and resource agent scripts
Resubmitting after a gerrit bug bungled the merge of
http://review.gluster.org/9621 (was it really a gerrit bug?)

Scripts related to NFS-Ganesha are in extras/ganesha/scripts.
Config files are in extras/ganesha/config.
Resource Agent files are in extras/ganesha/ocf

Files are copied to appropriate locations.

Change-Id: I137169f4d653ee2b7d6df14d41e2babd0ae8d10c
BUG: 1188184
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/9912
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2015-03-17 13:39:44 -07:00
Soumya Koduri
2b97b57cd8 Upcall: New xlator to store various states and send cbk events
Framework on the server-side, to handle certain state of the files
accessed and send notifications to the clients connected.

A generic and extensible framework, used to maintain states in
the glusterfsd process for each of the files accessed
(including the clients info doing the fops) and send
notifications to the respective glusterfs clients incase of
any change in that state.

This patch handles "Inode Update/Invalidation" upcall event.

Feature page:
        URL: http://www.gluster.org/community/documentation/index.php/Features/Upcall-infrastructure

Below link has a writeup which explains the code changes done -
        URL: https://soumyakoduri.wordpress.com/2015/02/25/glusterfs-understanding-upcall-infrastructure-and-cache-invalidation-support/

Change-Id: Ie3d724be9a3419fcf18901a753e8ec2df2ac802f
BUG: 1200262
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Reviewed-on: http://review.gluster.org/9535
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2015-03-17 05:08:07 -07:00
Aravinda VK
79009691c0 geo-rep: mountbroker user management
Non root geo-replication setup is now simplified. This
patch provides cli for mountbroker user and options management

To set Options,
    gluster system:: execute mountbroker opt <KEY> <VALUE>
    # for example,
    gluster system:: execute mountbroker opt mountbroker-root /var/mountbroker-root
    gluster system:: execute mountbroker opt geo-replication-log-group geogroup
    gluster system:: execute mountbroker opt rpc-auth-allow-insecure on

To remove option,
    gluster system:: execute mountbroker optdel <KEY>
    # for example,
    gluster system:: execute mountbroker optdel geo-replication-log-group

To add/edit user,
    gluster system:: execute mountbroker user <USERNAME> <VOLUMES>
    # for example
    gluster system:: execute mountbroker user geoaccount slavevol1,slavevol2

To remove user,
    gluster system:: execute mountbroker userdel <USERNAME>
    # for example
    gluster system:: execute mountbroker userdel geoaccount

For info,
    gluster system:: execute mountbroker info
    gluster system:: execute mountbroker -j info

For JSON output add -j after mountbroker, for example,
    gluster system:: execute mountbroker -j user geoaccount slavevol1,slavevol2

PS: Each peer prints its own JSON output, aggregator required from consumer side

BUG: 1136312
Change-Id: Ie52210c0bcc91ac2ffd3ba58988222ffca62b47f
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/9398
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: darshan n <dnarayan@redhat.com>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-03-17 04:56:24 -07:00
Anoop C S
0ef870741a Features/trash : Combined patches for trash translator
This is the combined patch set for supporting trash feature.
http://www.gluster.org/community/documentation/index.php/Features/Trash

Current patch includes the following features:
* volume set options for enabling trash globally and
  exclusively for internal operations like self-heal
  and re-balance
* volume set options for setting the eliminate
  path, trash directory path and maximum trashable
  file size.
* test script for checking the functionality of the
  feature
* brief documentation on different aspects of trash
  feature.

Change-Id: Ic7486982dcd6e295d1eba0f4d5ee6d33bf1b4cb3
BUG: 1132465
Signed-off-by: Anoop C S <achiraya@redhat.com>
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
Reviewed-on: http://review.gluster.org/8312
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-03-16 03:36:37 -07:00
Kotresh HR
7a9a66cc5f tools: Finds missing files in gluster volume given backend brickpath
The tool finds the missing files in a geo-replication slave volume.
The tool crawls backend .glusterfs of the brickpath, which is passed
as a parameter and stats each entry on slave volume mount to check
the presence of file. The mount used is aux-gfid-mount, hence no path
conversion is required and is fast. The tool needs to be run on every
node in cluster for each brickpath of geo-rep master volume to find
missing files on slave volume. The tool is generic enough and can be
used in non geo-replication context as well.

Most of the crawler code is leverged from Avati's xfind and is modified
to crawl only .glusterfs (https://github.com/avati/xsync)

Thanks Aravinda for scripts to convert gfid to path.

Change-Id: I84deaaaf638f7c571ff1319b67a3440fe27da810
BUG: 1187140
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/9503
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-03-15 21:20:03 -07:00
Kaleb S. KEITHLEY
8f34055a23 build: don't report (hide) systemtap config option
We don't actually support systemtap. We don't have any systemtap
enablement. The configure doesn't actually do anything to configure
systemtap support. It's confusing to show that systemtap is disabled,
someone might try to run --enable-systemtap, and then we'll show that
it's enabled, but it still doesn't actually do anything.

Hide it until such time as we actually have some real systemtap support

Change-Id: I8617121bee5bc724027e5f4d5eed00fd3c5a4ab2
BUG: 865734
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/9564
2015-03-10 10:22:13 -07:00
Niels de Vos
72dc1025dc posix: add ACL translation for the GF_POSIX_ACL_*_KEY xattr
Adding support for two virtual extended attributes that are used for
converting a binary POSIX ACL to a POSIX.1e long ACL text format. This
makes it possible to transfer the ACL over the network to a different OS
which can convert the POSIX.1e text format to its native structures.

The following xattrs are sent over RPC in SETXATTR/GETXATTR procedures,
and contain the POSIX.1e long ACL text format:

- glusterfs.posix.acl: maps to ACL_TYPE_ACCESS
- glusterfs.posix.default_acl: maps to ACL_TYPE_DEFAULT

acl_from_text() (from libacl) converts the text format into an acl_t
structure. This structure is then used by acl_set_file() to set the ACL
in the filesystem.

libacl-devel is needed for linking against libacl, so it has been added
to the BuildRequires in the .spec.

NetBSD does not support POSIX ACLs. Trying to get/set POSIX ACLs on a
storage server running NetBSD, an error will be returned with errno set
to ENOTSUP. Faking support, but not enforcing ACLs seems wrong to me.

URL: http://www.gluster.org/community/documentation/index.php/Features/Improved_POSIX_ACLs
BUG: 1185654
Change-Id: Ic5eb73d69190d3492df2f711d0436775eeea7de3
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/9627
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: soumya k <skoduri@redhat.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
2015-03-09 13:53:00 -07:00
Niels de Vos
bc2e58a436 testing: Switch to cmocka the successor of cmockery2
This uses https://cmocka.org/ as the unit testing framework.

With this change, unit testing is made optional as well. We assume there
is no cmocka available while building. cmocka will be enabled by default
later on. For now, to build with cmocka run:

    $ ./configure --enable-cmocka

This change is based on the work of Andreas (replacing cmockery2 with
cmocka) and Kaleb (make cmockery2 an optional build dependency).

The only modifications I made, are additional #defines in unittest.h for
making sure the unit tests function as expected.

Change-Id: Iea4cbcdaf09996b49ffcf3680c76731459cb197e
BUG: 1067059
Merged-change: http://review.gluster.org/9762/
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Change-Id: Ia2e955481c102d5dce17695a9205395a6030e985
Reviewed-on: http://review.gluster.org/9738
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2015-03-05 13:51:37 -08:00
Kaushal M
30357bcfcd build, glusterd: Add liburcu to build system
This patch adds liburcu related checks to the build system and updates
the spec file to require 'userspace-rcu'.

liburcu >= 0.7 is required to build GlusterFS, but 0.8 and above is
preferred. For cases when liburcu 0.7.x is the available version, some
function definitions (currently just one) from liburcu-0.8.6 have been
made available in /contrib/userspace-rcu/.

This change was developed on the git branch at [1]. This commit is a
combination of the following commits on the development branch.
  a5cd6bd Add userspace-rcu checks to configure.ac
  fe5ced3 Add URCU libs to glusterd libtool flags
  1e43302 Add local definition of cds_list_add_tail_rcu for
          liburcu-0.7
  98da755 Move local definition of cds_list_add_tail_rcu into contrib
  8c44dfd Update spec file to include userspace-rcu0466e33 Rename
  rculist-additional.h to rculist-extra.h
  947c7b3 Add rculist-extra.h to dist
  19f32ad Address review comments 9605/1

[1]: https://github.com/kshlm/glusterfs/tree/urcu

Change-Id: Ifbb617d0dacce8fa01214f894badb9d8cdcaf56f
BUG: 1191030
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/9605
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
2015-02-23 04:35:37 -08:00
Niels de Vos
c46070189e build: do not include automake/autoconf cache in the 'make dist' tarball
Remove the caches from the 'dist-hook' target that 'make dist' executes.

Also, there is no need to run ./configure inside contrib/argp-standalone
if it will not get used. configure.ac has been modified to only
configure the contrib/argp-standalone sources for distributions that do
not have the <argp.h> header available.

BUG: 1183538
Change-Id: Iedd67139ec83f0076e24ed0d575f9053ac1a94ec
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/9463
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
2015-01-30 10:55:49 -08:00
Niels de Vos
10e4add35f build: add a tmpfiles.d config file for /run/gluster
New distrubutions have a /run directory on a volatile tmpfs filesystem.
This causes /run/gluster to be removed with each reboot. A tmpfiles.d
configuration is used to create the directory on boot.

EL5 and EL-6 do not use /run, current Fedora versions do. By checking
%{_tmpfilesdir} in the .spec, we can identify if the distribution uses
tmpfiles.d.

Change-Id: I231e7d6603d573cb905246558e14a51577c0eb56
BUG: 1182934
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/9458
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com>
2015-01-19 00:55:31 -08:00
Kaleb S. KEITHLEY
c49a77001b api: versioned symbols in libgfapi.so for compatibility
Use versioned symbols to keep libgfapi at libgfapi.so.0.0.0

Revisited to address broken build on Mac OS X

See http://review.gluster.org/9036

Rebased to include http://review.gluster.org/#/c/9376/ (glfs_resolve())
but note that gerrit's "Rebase Change" couldn't do it.

N.B. noticed that glfs_get_volumeid() decl in glfs.h was missing
the __THROW, added it.

On systems using ELF and the GNU toolchain, symbol versions are created
with a .symver asm operand in the .c source file. Clang is claimed to
be compatible with gcc, so we'll pretend for now that this also works
with clang.

On Mac OS X, aliases are created with __asm "magic" in the .h header
file. In the normal case, when both the decl and defn match, that's
all that's needed. In our case though the decl and defn don't match ---
we have, e.g. a defn such as 'int glfs_foo(...)' and the corresponding
decl is 'int pub_glfs_foo(...)'. To make this work we create the necessary
aliases in the library at link time with the -alias_list link option.

Note that this results in there being pairs of symbols in the .dylib,
e.g. _pub_glfs_foo and _glfs_foo$GFAPI_3.4.0. We could use another
link option, -unexported_symbols_list to elide the _pub_glfs_* symbols.
(And we probably should.)

Linux symbol versioning was essentially copied from Solaris; in general
I would expect this to "just work" on Solaris, but until someone tries
we don't really know.

Change-Id: Icb96a3c2d80be7b6d7a6849bb9168f03a947f47c
BUG: 1160709
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/9143
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
2015-01-12 09:16:08 -08:00
Niels de Vos
fcdac758ad build: only install geo-rep scripts when enabled
When geo-replication is not enabled, the related scripts should not get
installed. EPEL-5 does not support geo-replication, and the installed
but unpackaged scripts cause rebuilding for .el5 to fail.

BUG: 1169005
Change-Id: I1b6a352b73bd1ed1c5b330f54e26e81aed9a5a4e
Reported-by: Lalatendu Mohanty <lmohanty@redhat.com>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/9221
Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2014-12-07 06:16:08 -08:00
Emmanuel Dreyfus
c233d3e041 glupy: build fix if python and glusterfs prefix differ
If python is installed in ${pythonprefix} and glusterfs
in ${glusterfsprefix}, we have the following values:
${PYTHON}-config --prefix   => ${pythonprefix}
$libdir                     => ${glusterfsprefix}/lib

Using LDFLAGS="-L`${PYTHON}-config --prefix`/$libdir" we lookf for
python libraries in ${pythonprefix}/${glusterfsprefix}/lib while
we should be looking for ${pythonprefix}/lib

Replacing $libdir by lib breaks bug 1159248, so let us look in both
${pythonprefix}/lib and ${pythonprefix}/$libdir

BUG: 1129939
Change-Id: I2fef1b795235d1543a0e5ac619c6c2d59127fb66
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/9137
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
2014-11-28 07:56:53 -08:00
Niels de Vos
66c789765d Replace copied (from rsync) checksum code by adler32() from zlib
The weak checksum code that is included in libglusterfs has initialy
been copied from the rsync sources. Instead of maintaining a copy of a
function, we should use a function from a shared library. The algorithm
seems to be Adler-32, zlib provides an implementation.

The strong checksum function has already been replaced by MD5 from
OpenSSL. It is time to also remove the comments about the origin of the
implementation, because it is not correct anymore.

Change-Id: I70c16ae1d1c36b458a035e4adb3e51a20afcf652
BUG: 1149943
Reported-by: Wade Mealing <wmealing@redhat.com>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/9035
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-11-21 09:12:20 -08:00
Niels de Vos
6ba258d2b7 pkg-config: make the version in gluster-api.pc backwards compatible
Once we released gluster-api.pc with version=4. Since then we undid the
library versioning and replaced it with symbol-versioning. The current
libgfapi.so has version 0, but the symbols have the version from the
main package at the time they were added.

Because other packages (like samba) use the pkg-config version, we can
not drop it, or decrease the version easily. The simplest solution is to
keep the version=4 and add sub-digits for the actual package/symbol
versions. In future, the version in gluster-api.pc will be like 4.3.x.y.

Change-Id: If359c8de5b847a7e818199a7246636113837da2d
BUG: 1166232
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/9154
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2014-11-20 09:57:19 -08:00
Niels de Vos
b6c553339c build: fix glupy linking warnings
While building glupy on x86_64, the following warnings are thrown:

  Making all in glupy
  Making all in src
    CC     glupy.lo
    CCLD   glupy.la
  /usr/bin/ld: skipping incompatible /usr/lib/libdl.so when searching for -ldl
  /usr/bin/ld: skipping incompatible /usr/lib/libutil.so when searching for -lutil
  /usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
  /usr/bin/ld: skipping incompatible /usr/lib/librt.so when searching for -lrt
  /usr/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching for -lpthread
  /usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc

The libraries to link against are in /usr/lib64 on x86_64 in Fedora,
RHEL and CentOS. Other architectures or distributions may use a
different path. Instead of hardcoding "/lib" in configure.ac, the
variable $libdir should be used so that the path gets adapted to the
distribution and architecture.

Change-Id: Iae5db3ee8a62959ccb7f958d7c95eb77c4d4b1dd
BUG: 1159248
Reported-by: Kiran Patil <kiran@fractalio.com>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/9033
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
2014-11-12 08:11:28 -08:00
Kaleb S. KEITHLEY
7e497871d1 api: versioned symbols in libgfapi.so for compatibility
Use versioned symbols to keep libgfapi at libgfapi.so.0.0.0

Some nits uncovered:

+ there are a couple functions declared that do not have an
  associated definition, e.g. glfs_truncate(), glfs_caller_specific_init()

+ there are seven private/internal functions used by heal/src/glfsheal
  and the gfapi master xlator (glfs-master.c): glfs_loc_touchup(),
  glfs_active_subvol(), and glfs_subvol_done(), glfs_init_done(),
  glfs_resolve_at(), glfs_free_from_ctx(), and glfs_new_from_ctx();
  which are not declared in glfs.h;

+ for this initial pass at versioned symbols, we use the earliest version
  of all public symbols, i.e. those for which there are declarations in
  glfs.h or glfs-handles.h.
  Further investigation as we do backports to 3.6, 3.4, and 3.4
  will be required to determine if older implementations need to
  be preserved (forward ported) and their associated alias(es) and
  symbol version(s) defined.

FWIW, we should consider linking all of our libraries with a map, it'll
result in a cleaner ABI. Perhaps something for an intern to do or a
Google Summer of Code project.

Change-Id: I499456807a5cd26acb39843216ece4276f8e9b84
BUG: 1160709
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/9036
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-11-07 00:23:34 -08:00
Emmanuel Dreyfus
1a735e300a glupy: portability fixes
Fixes portability problems so that NetBSD passes tests/features/glupy.t

- Use python-config to detect python build environment on all systems,
  not just Linux and Darwin.
- Get the site-package directory from python and make sure we install
  glupy.py there, Previously we installed within glusterfs prefix,
  which caused a problem if it was different that python's prefix.
- Set PYTHONPATH for tests so that the detected site-packages is used
  in python's search path. This should be useless, but let us have it
  just in case.
- Pass glupy.so path from glusterfsd to glupy.py through an
  environment variable and use it in CDLL instead of "", as the
  later seems not portable (at least it fails on NetBSD).
- Use gil_init_key pthread_getspecific to avoid deadlocks (that
  code was #ifdef out, perhaps because it was not needed on Linux,
  but it seems to be required for NetBSD.
- Recover the error message from Python and send it to the logs
  to help debugging problems.

BUG: 1129939
Change-Id: Icc71e77d6940f0759cc14c5c5cf7ca6fa431e0d2
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8978
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
2014-11-05 22:28:09 -08:00
Pranith Kumar K
7e8eefca2c heal: glfs-heal implementation
Thanks a lot to Niels for helping me to get build stuff right.

Change-Id: I634f24d90cd856ceab3cc0c6e9a91003f443403e
BUG: 1147462
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/6529
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2014-10-15 01:22:02 -07:00
Emmanuel Dreyfus
473c34f895 Do not hardcode umount(8) path, emulate lazy umount
1) Use a system-dependent macro for umount(8) location instead of
relying on $PATH  to find it, for security and portability sake.

2) Introduce gf_umount_lazy() to replace umount -l (-l for lazy) invocations,
which is only supported on Linux; On Linux behavior in unchanged. On other
systems, we fork an external process (umountd) that will take care of
periodically attempt to unmount, and optionally rmdir.

BUG: 1129939
Change-Id: Ia91167c0652f8ddab85136324b08f87c5ac1e51d
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8649
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Csaba Henk <csaba@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-10-03 07:57:47 -07:00
Harshavardhana
2dd53eb4de porting: various fixes regression tests OSX/FreeBSD
- `wc -l` on OSX/FreeBSD adds spurious spaces, this clobbers
  up TAP output parsers - fix it.
- `umount -l` doesn't exist on OSX/FreeBSD use 'umount -f' if
   available.
- Add check for 'file' version, to handle mime type variations
  across versions
- Converge 'glusterfs --attribute-timeout=0 --entry-timeout=0'
  into '$GFS'
- Modify remaining 'mount -t nfs' to use 'mount_nfs'
- Update sha1sum for OSX to use 'openssl sha1'.

Change-Id: Id1012faa5d67a921513d220e7fa9cebafe830d34
BUG: 1131713
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/8501
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
2014-08-29 09:13:02 -07:00
Harshavardhana
c77a77ef0f osx: Enable qemu feature build on Darwin
Change-Id: Ie5d437aa6c52c180fd8d54680c5f882e75c0bf7e
BUG: 1089172
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/8448
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
2014-08-11 09:02:51 -07:00
Emmanuel Dreyfus
ccb5dc01b8 Always build EC xlator
Now EC xlator does not require MMX anymore, always build it.

BUG: 764655
Change-Id: I50a64e22c080f2759eaa57786e7f69c34f11f89c
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8451
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Harshavardhana <harsha@harshavardhana.net>
2014-08-10 15:14:09 -07:00
Emmanuel Dreyfus
b97ade3b05 Search zlib without pkg-config
NetBSD has zlib installed in base system and no .pc file for it. In
order to discover it, fallback to AC_CHECK_LIB is PKG_CHECK_MODULES
fail to find it.

This enables cdc xlator, and we pass tests/basic/cdc.t

BUG: 764655
Change-Id: Ide84402aa38edc2709d12e2530401c6b8c722529
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8437
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Harshavardhana <harsha@harshavardhana.net>
2014-08-09 15:29:26 -07:00
Harshavardhana
2ec6ea43f2 build: make GLUSTERD_WORKDIR rely on localstatedir
- Break-way from '/var/lib/glusterd' hard-coded previously,
  instead rely on 'configure' value from 'localstatedir'
- Provide 's/lib/db' as default working directory for gluster
  management daemon for BSD and Darwin based installations
- loff_t is really off_t on Darwin
- fix-off the warnings generated by clang on FreeBSD/Darwin
- Now 'tests/*' use GLUSTERD_WORKDIR a common variable for all
  platforms.
- Define proper environment for running tests, define correct PATH
  and LD_LIBRARY_PATH when running tests, so that the desired version
  of glusterfs is used, regardless where it is installed.
  (Thanks to manu@netbsd.org for this additional work)

Change-Id: I2339a0d9275de5939ccad3e52b535598064a35e7
BUG: 1111774
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8246
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2014-08-07 01:17:29 -07:00
Anders Blomdell
e8a1fc34ad 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>
2014-07-30 08:07:11 -07:00
Emmanuel Dreyfus
5986d22e62 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>
2014-07-27 11:57:24 -07:00
Emmanuel Dreyfus
1706151a42 Disable Erasure Code xlator if MMX is missing
Erasure Code xlator requires MMX instruction set.
Disable building it if MMX is missing.

BUG: 764655
Change-Id: Id9fe87db33e00c5630c1f3633ebd50fc4ebaec4d
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8366
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-07-23 16:13:38 -07:00
Luis Pabon
13f644f783 build: Support for unit tests using Cmockery2
This patch will allow for developers to create unit tests for
their code.  Documentation has been added to the patch and
is available here:

doc/hacker-guide/en-US/markdown/unittest.md

Also, unit tests are run when RPM is created.

This patch is a replacement for http://review.gluster.org/#/c/7281
which removed unit test infrastucture from the repo due to multiple
conflicts.  Cmockery2 is now available in Fedora and EPEL, and soon
to be available in Debian and Ubuntu.  For all other operating
systems, please install from the source:

https://github.com/lpabon/cmockery2

BUG: 1067059

Change-Id: I1b36cb1f56fd10916f9bf535e8ad080a3358289f
Signed-off-by: Luis Pabón <lpabon@redhat.com>
Reviewed-on: http://review.gluster.org/7538
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-07-18 10:55:51 -07:00
Humble Chirammal
fc84c5af7b gfapi : remove gfapi.py to avoid confusion
python binding of libgfapi is evolving via libgfapi-python
project. The example available here confuses end users,
so removing it from this path.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
Bug Id: 1119328
> Reviewed-on: http://review.gluster.org/7920
> Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
> Tested-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
> Reviewed-by: Thiago da Silva <thiago@redhat.com>
> Reviewed-by: Prashanth Pai <ppai@redhat.com>
> Reviewed-by: Vijay Bellur <vbellur@redhat.com>

Change-Id: I17b3aa0f0505342496019ce012cca21d84184027
Reviewed-on: http://review.gluster.org/8237
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-07-14 09:47:36 -07:00
Xavier Hernandez
ad112305a1 cluster/ec: Added erasure code translator
Change-Id: I293917501d5c2ca4cdc6303df30cf0b568cea361
BUG: 1118629
Signed-off-by: Xavier Hernandez <xhernandez@datalab.es>
Reviewed-on: http://review.gluster.org/7749
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-07-11 10:33:40 -07:00
Harshavardhana
5723645715 porting: Enable 64bit inode properly on Darwin
Usage of -D__DARWIN_64_BIT_INO_T was wrong, use

-D_DARWIN_USE_64_BIT_INODE instead

Change-Id: I4b532232d0a61fe30f08c41ffeba50fff4ecd79e
BUG: 1089172
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/8219
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
2014-07-02 17:26:32 -07:00
Harshavardhana
1b74cf9929 porting: Port for FreeBSD rebased from Mike Ma's efforts
- Provides a working Gluster Management Daemon, CLI
- Provides a working GlusterFS server, GlusterNFS server
- Provides a working GlusterFS client
- execinfo port from FreeBSD is moved into ./contrib/libexecinfo
  for ease of portability on NetBSD. (FreeBSD 10 and OSX provide
  execinfo natively)
- More portability cleanups for Darwin, FreeBSD and NetBSD
- Provides a new rc script for FreeBSD

Change-Id: I8dff336f97479ca5a7f9b8c6b730051c0f8ac46f
BUG: 1111774
Original-Author: Mike Ma <mikemandarine@gmail.com>
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/8141
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
2014-07-02 17:20:34 -07:00
Vijay Bellur
85ee12f7c0 Revert "gfapi : remove gfapi.py to avoid confusion"
This reverts commit d0547a28f59d80ed572652af3e327b761c4e540f

Change-Id: I79ff562fff33d4ad7ca34c6442eb0e980890965a
Reviewed-on: http://review.gluster.org/8139
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
2014-06-20 07:49:12 -07:00
Humble Chirammal
d0547a28f5 gfapi : remove gfapi.py to avoid confusion
python binding of libgfapi is evolving via libgfapi-python
project. The example available here confuses end users,
so removing it from this path.

Change-Id: I90a0a29972f5230b8b440e8941aaca8a62e497a6
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
Reviewed-on: http://review.gluster.org/7920
Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
Tested-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
Reviewed-by: Thiago da Silva <thiago@redhat.com>
Reviewed-by: Prashanth Pai <ppai@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-20 03:39:18 -07:00
Harshavardhana
ea58f25646 build: Avoid gcc pragmas when clang is enabled
Change-Id: I86544a9bfd24ef1a69315c0f6c3abcdd9aeb2c69
BUG: 1089172
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/7932
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2014-06-04 16:24:32 -07:00
Emmanuel Dreyfus
4f9314a5ed NetBSD qemu build fixes
Fix NetBSD build for glusterfs built in qmeu sources

BUG: 764655
Change-Id: I4428a88b1e0d7c5f6740022861ffe230dbbd84bd
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/7815
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-06-02 03:58:32 -07:00
Emmanuel Dreyfus
a9d4b942d7 NetBSD build fix for gettext
NetBSD's gettext is in libintl, hence search it at configure time.

BUG: 764655
Change-Id: I651a74fe49c3f087fe135dab3453fd5b18b4268a
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/7880
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-05-29 23:30:01 -07:00
Raghavendra Bhat
cc0378d39f user servicable snapshots
Change-Id: Idbf27dbe088e646a8ab81cedc5818413795895ea
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Signed-off-by: Anand Subramanian <anands@redhat.com>
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/7700
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-05-29 09:25:46 -07:00
Niels de Vos
cec37c9b66 logging: remove unused message-id scripts
The current unused implementation for message-ids in the logs depends on
automatically generated files. The generated files are not included in
the distributed tarball. This causes issues when distributions build
packages, they need to re-run ./autogen.sh to create the needed files.

I thought of including the generated files in the distribution tarball.
However, the contents of these files are not actively used, so it seems
to make more sense to drop it all together. These functions were the
only users of libintl and gettext too, so dropped the requirement
checking from configure.ac.

A replacement for the message-id logging framework is in progress. Any
changes that this patch makes, can be reverted in the submission of
patches for the new framework.

Reference: http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/6212
Change-Id: Iea82dd3910944a5c6be3ee393806eccabd575e11
BUG: 1038391
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/7714
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-05-22 02:48:58 -07:00
Emmanuel Dreyfus
618d465295 NetBSD build fixes
- Shell scripts: == is specific to bash and ksh. Use = instead.
- Shell scripts: use sh instead of bash if bash functionnality is not used
- Shell scripts: ${var/search/replace} is specific to bash
- sed: The -i option is specific to GNU sed.
- Makefiles: $< outside of generic rules only work in GNU make.
- xdrproc_t() is not universally defined as variadic. Do not specify third
  argument if it is not used
- NetBSD FUSE specific: only include <perfuse.h> in FUSE client code,
  it harms in other locations
- configure: Search for gettext() in libintl as NetBSD stores it there
- Like MacOS X, NetBSD has unmount(2) and not umount(2) (un vs u)

Some other build issues previously included in this change were
removed:
- __THROW macro, addressed in http://review.gluster.com/#/c/7757/
- getmntent() compat shared with MacOS X, in http://review.gluster.com/#/c/7722/

This patchset adds warning fixes for mount_glusterfs

BUG: 764655
Change-Id: I2f1faf8ff96362d3e2baf237b943df619011f1f4
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/7783
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
2014-05-17 11:53:34 -07:00
Soumya Koduri
5adb10b9ac libgfapi: Added support to fetch volume info from glusterd and store in glfs object.
Defined new APIs in the libgfapi module, given a glfs object,
 * to send handshake RPC call to glusterd process to fetch UUID of the volume
 * store it in the glusterfs_context linked to the glfs object.
 * to parse UUID from its cannonical string format into 16-byte array
   before sending it to the libgfapi users.

Defined a RPC call in glusterd which can be used to query volume related
info by other processes using 'clnt_handshake_procs'.

Note - Currently this RPC call to glusterd process is used only to fetch UUID.
But it can be extended to get other volume related structures as well.

In addition to the above, defined a new variable to keep track of such handshake
RPCs still in progress to make sure all the corresponding RPC callbacks have been
processed before libgfapi returns the glfs object initialized.

Also bumping up the GFAPI current version number since there is a new API
"glfs_get_volume_id" defined and exposed by libgfapi as part of these changes.

Change-Id: I303f76d7177d32d25bdb301b1dbcf5cd73f42807
BUG: 1090363
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Reviewed-on: http://review.gluster.org/7218
Reviewed-by: Anand Avati <avati@redhat.com>
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-05-11 02:47:42 -07:00
Harshavardhana
4f8c7cc34d runtime: Disable optimization for OSX versions < 10.9
Optimization flags has led to segfaults at wrong locations
throughout gluster code for versions < 10.9

Assuming this to be a compiler bug, disable optimization
flags

Change-Id: Ia2dc983dc5bb06935f03b68c07688ce41255d7da
BUG: 1089172
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/7656
Reviewed-by: Justin Clift <justin@gluster.org>
Tested-by: Justin Clift <justin@gluster.org>
2014-05-08 20:13:50 -07:00
Anand Avati
8160399a36 meta: (re-)Implement Meta translator
The meta translator exposes details about glusterfs itself
in the form of a virtual namespace.

Loading the translator on the client side creates the
meta virtual view under $mntpoint/.meta by default. The
directory is not listed (even with ls -a) and can be
accessed by doing a "cd /mnt/.meta"

Change-Id: I5ffdf39203841a9562a8280a1f79dc76d4dded5d
BUG: 1089216
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/7509
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
2014-05-05 17:28:55 -07:00
Meghana M
0088e318c1 cli/hooks : Add volume set options to enable/disable nfs-ganesha support.
1. gluster volume set nfs-ganesha.enable ON/OFF
If the option is set to ON, the volume field in the nfs-ganesha configuartion file is
edited. Gluster-nfs is disabled on that volume and the volume is exported using
nfs-ganesha.

2.gluster volume set nfs-ganesha.host IP
This is used to provide the IP of the nfs-ganesha host.

Note : nfs-ganesha.host MUST be set before using nfs-ganesha.enable ON

The switch from gluster-nfs to nfs-ganesha is mostly done by the hook-scripts
in the post phase of the 'set' option. As a result, gluster volume reset does not
function as it is expected to. By default, nfs-ganesha will be set to off but the
process  will not be killed.

Hence, a few changes have to be made post 'reset' option as well. Those changes
also have been added.

Change-Id: I7fdc14ee49d1724af96eda33c6a3ec08b1020788
BUG: 1092283
Signed-off-by: Meghana <mmadhusu@redhat.com>
Reviewed-on: http://review.gluster.org/7321
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-05-03 07:24:07 -07:00
Harshavardhana
9819fcedf1 rpcgen: Remove autogenerated files instead build on demand
Avoid modifying autogenerated files and keeping them in
repository - autogenerate them on demand from ".x" files

Change-Id: I2cdb1fe9b99768ceb80a8cb100fa00bd1d8fe2c6
BUG: 1090807
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/7526
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2014-04-25 13:29:25 -07:00
Harshavardhana
841ac48b41 osx: Compilation fixes
Change-Id: I822936cbeb4ec8af46be8e94644ea666b919ae5c
BUG: 1089172
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/7556
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2014-04-25 12:02:30 -07:00
Harshavardhana
a3cb38e3ed build: MacOSX Porting fixes
git@forge.gluster.org:~schafdog/glusterfs-core/osx-glusterfs

Working functionality on MacOSX

 - GlusterD (management daemon)
 - GlusterCLI (management cli)
 - GlusterFS FUSE (using OSXFUSE)
 - GlusterNFS (without NLM - issues with rpc.statd)

Change-Id: I20193d3f8904388e47344e523b3787dbeab044ac
BUG: 1089172
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Signed-off-by: Dennis Schafroth <dennis@schafroth.com>
Tested-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Dennis Schafroth <dennis@schafroth.com>
Reviewed-on: http://review.gluster.org/7503
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2014-04-24 14:41:48 -07:00