summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* glusterfs-api.pc: pkgconfig for API consumersAnand Avati2012-07-183-2/+26
| | | | | | | | | | Change-Id: I08c60ff9ec5d336077c39f903720f8850d4ddc72 BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3665 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* gfapi: API/library for accessing gluster volumesAnand Avati2012-07-1812-1/+2864
| | | | | | | | | | | Change-Id: Ie4cbcf91b58218bebf23cf951c313aceeb29f311 BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3664 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Bharata B Rao <bharata.rao@gmail.com>
* libglusterfs: remove debug log messages from gidcacheBrian Foster2012-07-181-4/+0
| | | | | | | | | | | | The debug log messages for every cache lookup/add pollute the debug output. BUG: 800892 Change-Id: I6b75fd5b7005b8c007106347de8827a0d6c2fd03 Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-on: http://review.gluster.com/3692 Reviewed-by: Anand Avati <avati@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* mount/fuse: check for fuse inval notify support when fopen-keep-cache enabledBrian Foster2012-07-181-1/+15
| | | | | | | | | | | | | | | | | The fopen-keep-cache feature relies on the fuse notification system to operate correctly. As Csaba has pointed out, the inode invalidation functionality was added in FUSE version 7.12. Require that the user have 7.12 or later to enable fopen-keep-cache. If not supported, warn the user and disable the feature. BUG: 833564 Change-Id: Ib9eecb56b689d8edff118b34e2dcc7dba6539b04 Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-on: http://review.gluster.com/3690 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* geo-rep / gsyncd: rsync option cleanups, fixesCsaba Henk2012-07-182-2/+6
| | | | | | | | | | | | - add two tunables for rsync: "rsync-options" and "rsync-ssh-options" - always pass "--no-implied-dirs" to rsync Change-Id: I3d67a4cba8cabd681edac80e6b1fb8ea322008bd BUG: 841062 Signed-off-by: Csaba Henk <csaba@redhat.com> Reviewed-on: http://review.gluster.com/3682 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* stripe: filter coalesce key in getxattr()/listxattr()Amar Tumballi2012-07-171-0/+3
| | | | | | | | | | | | as 'stripe-coalesce' is an internal key, no need to show it on top of the mount-point. Change-Id: Iab836e73d59c42774db8a2eee13fe3b0cd994bc9 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 801887 Reviewed-on: http://review.gluster.com/3680 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shishir Gowda <sgowda@redhat.com>
* glusterfs_ctx_t: un-globalize the filesystem contextAnand Avati2012-07-1720-133/+121
| | | | | | | | | | | | | | | | | | | | | | | | So far there has been a global glusterfs_ctx_t object which represents the running instance of the filesystem (client or server). It contains the various graphs, connection to the management daemon over which new graphs are obtained, calls stacks issued on this filesystem, and a bunch of such things. With the introduction of libgfapi, it is no more true that there will be only one filesystem context in a process. Applications can be written to use libgfapi and obtain serveral instances of different filesystems/volumes in the same process. This involves messy untangling of assumptions inside libglusterfs that there would only be one global glusterfs_ctx_t and offload that assumption to glusterfsd/ and cli/ (where it is true). Change-Id: Ifd7d1259428c26076140a5764a2dc7361694139c BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3678 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* storage/posix: use the size returned by getxattr to allocate memoryRaghavendra Bhat2012-07-171-2/+2
| | | | | | | | | Change-Id: I71c234b12a1d16405e508b715932022fdce346f0 BUG: 838195 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.com/3681 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* rpc-transport/socket: Add SSL support.Jeff Darcy2012-07-176-85/+688
| | | | | | | | | | | | | Based on OpenSSL. Key/certificate management is still manual. Enabling SSL also enables multi-threading, though multi-threading can be forced on or off using a separate option. Change-Id: Icd9f256bb2fd8c6266a7abefdff16936b4f8922d BUG: 764731 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.com/362 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* common-utils: implement generate_glusterfs_ctx_id()Anand Avati2012-07-174-65/+37
| | | | | | | | | | | | | This patch creates a common and shared version of the often copy/ pasted generate_uuid() function, which is used to create an ID string to uniquely identify an instance of a glusterfs process/glusterfs_ctx_t. Change-Id: Ie4e697ae28b6e954c5c261c69e37738f289d77e4 BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3677 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* storage/posix: use ssize_t variable to get the return value of getxattrRaghavendra Bhat2012-07-172-45/+63
| | | | | | | | | | Change-Id: Ida065e108a1d2a61b134fb847e8c4981b46fc3c6 BUG: 838195 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.com/3673 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* build: Create directories and files that get created during runtimeNiels de Vos2012-07-171-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should not be needed for files marged as "ghost", but rpm-4.9 is broken in this respect :-( Building the packages works again: $ make dist $ rpmbuild -ta glusterfs-3git.tar.gz The now created files and directories are not packaged in the RPM, but are marked as belonging to the packages. Here a example for glusterfs-geo-replication: $ rpm -qlp glusterfs-geo-replication-3git-1.fc17.x86_64.rpm \ | grep /var/lib /var/lib/glusterd/geo-replication /var/lib/glusterd/geo-replication/gsyncd.conf $ rpm2cpio < glusterfs-geo-replication-3git-1.fc17.x86_64.rpm \ | cpio -t --quiet '/var/lib/*' $ Change-Id: I32019cfbf40e25d9b7ce875fa92b98bae19dabee BUG: 839668 See-also: https://bugzilla.redhat.com/show_bug.cgi?id=839656 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.com/3674 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* libglusterfs,mount/fuse: implement gidcache mechanism in fuse-bridgeBrian Foster2012-07-1714-120/+353
| | | | | | | | | | | | | | | | | | | | | | | | | | This change genericizes the cache mechanism implemented in commit 8efd2845 into libglusterfs/src/gidcache.[ch] and adds fuse-bridge as a client. The cache mechanism is fundamentally equivalent, with some minor changes: - Change cache key from uid_t to uint64_t. - Modify the cache add logic to locate and use an entry with a matching ID, should it already exist. This addresses a bug in the existing mechanism where an expired entry supercedes a newly added entry in lookup, causing repeated adds and flushing of a cache bucket. The fuse group cache is disabled by default. It can be enabled via the 'gid-timeout' fuse-bridge translator option and accompanying mount option (i.e., '-o gid-timeout=1' for a 1s entry timeout). BUG: 800892 Change-Id: I0b34a2263ca48dbb154790a4a44fc70b733e9114 Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-on: http://review.gluster.com/3676 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* common-utils: implement iov_copyAnand Avati2012-07-161-1/+38
| | | | | | | | | | | Change-Id: I7ab97279dafc1211b417e1c03332572887453c66 BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3663 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Shishir Gowda <sgowda@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* geo-rep / gsyncd: fixes to communication with child processesCsaba Henk2012-07-141-7/+11
| | | | | | | | | | | | due to not using the proper Python keyword, errhandler thread was possible to run into empty select Signed-off-by: Csaba Henk <csaba@redhat.com> BUG: 764678 Change-Id: I3c39e718e72545c27d50fd73aa6daf54062331b0 Reviewed-on: http://review.gluster.com/3560 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* geo-rep / gsyncd: sanitize error log of external commandsCsaba Henk2012-07-141-2/+10
| | | | | | | | | | | | | | If a command invoked by gsyncd fails, gsyncd makes a log of what comes out on its stderr. So far the log indeterministically broke lines at random places. Now put some effort into reconstructing original lines and having a faithful log. BUG: 764678 Change-Id: I16fcc75d3e0f624c10c71d9b37c937ca677087cc Signed-off-by: Csaba Henk <csaba@redhat.com> Reviewed-on: http://review.gluster.com/3561 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* storage/posix: implement native linux AIO supportAnand Avati2012-07-149-6/+668
| | | | | | | | | | | Configurable via cli with "storage.linux-aio" settable option Change-Id: I9929e0d6fc1bbc2a0fe1fb67bfc8d15d8a483d3f BUG: 837495 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3627 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* syncop: accomodate non-syncenv callsAnand Avati2012-07-132-9/+63
| | | | | | | | | | | | | | | | Use mutex/cond and support syncop_XXXXXX() calls in non-syncenv environments. syncenv environments continue to use swapcontext based soft context switches. In non-syncenv environments this blocks the caller thread on the mutex. The intended use case is in libgfapi where it is expected to block the caller thread while performing synchronous calls. Change-Id: Id6470c99bdc2fe4b7610372139f7fa99b2da400b BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3662 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* cli-xml-output.c: avoid NULL-deref upon OOMJim Meyering2012-07-131-1/+1
| | | | | | | | | | | | Fix typo: s/buf/*buf/ in test after *buf = xmlBufferPtr(... Spotted by coverity. Change-Id: I92cd317832818647009a74f2a8407b5d3ecb958c BUG: 789278 Signed-off-by: Jim Meyering <meyering@redhat.com> Reviewed-on: http://review.gluster.com/3670 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* gsyncd: don't dereference NULL upon failed reallocJim Meyering2012-07-131-1/+1
| | | | | | | | | | | | Fix typo: s/buf/*buf/ in test for failed *buf = realloc... Spotted by coverity. Change-Id: Ie1db59956e331c3691f4ed470a3fbaf2bd2e2055 BUG: 789278 Signed-off-by: Jim Meyering <meyering@redhat.com> Reviewed-on: http://review.gluster.com/3669 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* remove useless if-before-free (and free-like) functionsJim Meyering2012-07-13114-1483/+727
| | | | | | | | | | | | See comments in http://bugzilla.redhat.com/839925 for the code to perform this change. Signed-off-by: Jim Meyering <meyering@redhat.com> BUG: 839925 Change-Id: I10e4ecff16c3749fe17c2831c516737e08a3205a Reviewed-on: http://review.gluster.com/3661 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* no semantic change: reverse condition and if/else clauses...Jim Meyering2012-07-131-3/+3
| | | | | | | | | | | | | Reverse an if-condition and the corresponding then/else code blocks to hide a false-positive if-before-GF_FREE from the useless-if-before-free script. Signed-off-by: Jim Meyering <meyering@redhat.com> BUG: 839925 Change-Id: Ia68558218d63ae77b6c1c85e15231b66cce5bd49 Reviewed-on: http://review.gluster.com/3651 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* libglusterfs: syncop for flush ()Rajesh Amaravathi2012-07-132-0/+32
| | | | | | | | | | Change-Id: I17f925345782313c75102c4767121ba8e283028e BUG: 764813 Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com> Reviewed-on: http://review.gluster.com/3667 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* fuse/md-cache: add support for the 'fopen-keep-cache' mount optionBrian Foster2012-07-1311-22/+219
| | | | | | | | | | | | | | | | | | | | | | fopen-keep-cache disables unconditional page-cache invalidations on file open in fuse (via FOPEN_KEEP_CACHE) and replaces that behavior with detection of remote changes and explicit invalidations from mount/fuse. This option improves local caching through the page cache and native client. This change defines a new 'invalidate' translator callback to identify when an inode's cache mapping has been determined to be invalid. md-cache implements the policy to detect and invoke inode invalidations. fuse-bridge and io-cache implement invalidate handlers to invalidate the respective caches (page cache in the case of fuse). BUG: 833564 Change-Id: I99818da5777eaf06276c1c0b194669f5bab92d48 Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-on: http://review.gluster.com/3584 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* protocol/server: return 'xdata' even in case of errorAmar Tumballi2012-07-121-126/+133
| | | | | | | | | | | | | helps to better utilize dict for more clarity on errors, if required. Change-Id: I3ff90e16be946e5f60974d4bde68a729d596c9de Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 826982 Reviewed-on: http://review.gluster.com/3633 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* core: remove the unused files - round 2Amar Tumballi2012-07-1240-19881/+0
| | | | | | | | | BUG: 764890 Change-Id: I3eb626eeaa2a09f0e248444f560c2a0eaf46c642 Signed-off-by: Amar Tumballi <amarts@redhat.com> Reviewed-on: http://review.gluster.com/3660 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* rpc: variable name changesAmar Tumballi2012-07-1212-495/+495
| | | | | | | | | | | | | 's/3_1/3_3/g' in case of glusterfs protocol 's/3_1_/_/g' in case of CLI and mgmt protocol Change-Id: I6e6510d02c05f68f290c52ed284c04576326e12c Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 764890 Reviewed-on: http://review.gluster.com/3632 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* extras: install clear_xattrs.shNiels de Vos2012-07-121-1/+1
| | | | | | | | | | | | The script was not installed by default, this breaks building the RPM packages since Change-Id Iba695a6d19389fbc1776da5e939d67318916aadf. Change-Id: I4fb982cb5217dc7b3ec3c7a664dd3997a2e05170 BUG: 812214 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.com/3659 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* calls to dict_allocate_and_serialize() are not 64-bit cleanKaleb S. KEITHLEY2012-07-128-109/+77
| | | | | | | | | | | | | | | | | | | | | | | All calls to dict_allocate_and_serialize() pass the address of a 32-bit type, but must cast it to the 64-bit pointer type (size_t *). This happens to work on LE machines, but even if it's apparently benign, it's still a bug. On BE machines it is not benign. GF_PROTOCOL_DICT_SERIALIZE() hacks around it by creating a size_t temp var, but that's, well, a hack, IMO when you consider that all the callers are actually passing &<u_int>; the param should just be a u_int * and eliminate the buggy casts and the temp var in the macro. Nobody apparently uses the Fedora/EPEL PPC RPMs, but they might. People are trying to build gluster.org bits on SPARC and tripping over this. Change-Id: I92ea139f9e3e91ddbbb32a51b96fa582a9515626 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> BUG: 838928 Reviewed-on: http://review.gluster.com/3642 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* geo-rep: don't let unexpected status provoke undefined behaviorJim Meyering2012-07-121-5/+10
| | | | | | | | | | | | | | | | | | | | glusterd_gsync_read_frm_status reads what is expected to be a NUL- terminated status string from the specified file, but makes two mistakes when trying to do the favor of trimming trailing spaces. Do not let a leading NUL byte of status cause us to read buf[-1] and possibly to clear that and any preceding "trailing" spaces. Do not let a blen-byte input (with no NUL byte) cause our use of strlen to access beyond the end of non-NUL-terminated buffer. I looked at this code because coverity reported that it was assuming a read-provided buffer to be NUL-terminated. Change-Id: I140be0948e31196e5be08766d4e6400bf6f4dfa1 BUG: 789278 Signed-off-by: Jim Meyering <meyering@redhat.com> Reviewed-on: http://review.gluster.com/3647 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* extras: add clear_xattrs.sh to the glusterfs-server sub-packageNiels de Vos2012-07-121-0/+4
| | | | | | | | | Change-Id: Iba695a6d19389fbc1776da5e939d67318916aadf BUG: 812214 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.com/3644 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* storage/posix: handle getxattr failures gracefullyRaghavendra Bhat2012-07-112-7/+61
| | | | | | | | | | | | | | Use proper variable types for getting return value of getxattr calls, which otherwise can lead to segfaulting of processes or page allocation failures in the kernel. Change-Id: I62ab5d6c378447090c19846f03298c3afc8863ba BUG: 838195 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.com/3640 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* core: check for pre-allocated blocks in backend fs, fix it.Amar Tumballi2012-07-111-0/+18
| | | | | | | | | | | | | | | | | | | | There is a possibility that the backend FS (like XFS) can allocate blocks beyond EOF for better performance reasons, which results in 'st_blocks' with higher values than what is consumed by the file descriptor. This would break few logic inside GlusterFS, like quota behavior etc, thus we need the exact number of blocks which are consumed by the file to the higher layers inside GlusterFS. Currently, this logic won't work for sparse files (ie, file with holes) Change-Id: Ied216733a8862e84f7da8386ae0a144f3f5cd5f2 BUG: 817343 Signed-off-by: Amar Tumballi <amarts@redhat.com> Reviewed-on: http://review.gluster.com/3631 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterfsd: don't ignore tmpfile write failure (2x)Jim Meyering2012-07-111-0/+7
| | | | | | | | | | | | | | | | | | | In both glusterfs_volfile_reconfigure and mgmt_getspec_cbk, we fwrite to a temporary file, fflush the stream, and then rewind and read from it. However, if either the fwrite or fflush were to fail, we would have ignored a write failure and would then read and process corrupt or incomplete input. In each case, add a test of ferror so that we don't ignore the write failure. Found by inspection. Change-Id: I8e84deb7d020a907870c9da2dde5c7371ce6ddb7 BUG: 789278 Signed-off-by: Jim Meyering <meyering@redhat.com> Reviewed-on: http://review.gluster.com/3648 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* cli: cli_cmd_get_confirmation: don't reference answer[-1] for NUL inputJim Meyering2012-07-111-2/+2
| | | | | | | | | Change-Id: I83baa54fc5392e92a6a451c549d356ff1ffc92cb BUG: 789278 Signed-off-by: Jim Meyering <meyering@redhat.com> Reviewed-on: http://review.gluster.com/3606 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* cli: print_brick_status: don't smash stackJim Meyering2012-07-111-8/+3
| | | | | | | | | | | | | | | | | | For bricklen > 110 (i.e., 2 * fieldlen), the if-clause would be executed 2 or more times, making strncpy write past the end of "buf", clobbering the stack. Rewrite, removing unnecessary use of strncpy, strlen and decl/use of the temporary buffer, and instead, specifying precision via a printf-style format directive. Coverity identified the static buffer overrun. Change-Id: I176386e752c397dea22265de9f3c6eb631334f4f BUG: 789278 Signed-off-by: Jim Meyering <meyering@redhat.com> Reviewed-on: http://review.gluster.com/3646 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* read_conf: don't let a corrupt config file cause invalid line[-1] referenceJim Meyering2012-07-111-2/+2
| | | | | | | | | Change-Id: Ifbc698768d9418a54c1501efa335edd4048cfd41 BUG: 789278 Signed-off-by: Jim Meyering <meyering@redhat.com> Reviewed-on: http://review.gluster.com/3603 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* gsyncd: don't let a bogus config file make us read/write buf[-1]Jim Meyering2012-07-111-2/+4
| | | | | | | | | Change-Id: Ic55c28c572c1878f8a223ae2fd25d301a7ef0c12 BUG: 789278 Signed-off-by: Jim Meyering <meyering@redhat.com> Reviewed-on: http://review.gluster.com/3596 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd: avoid buffer overrun for over-long volnameJim Meyering2012-07-111-1/+7
| | | | | | | | | | | | | | | | | [in glusterd_store_is_valid_brickpath] When strlen(volname) is no smaller than sizeof(volinfo->volname), volinfo->volname would end up not being NUL-terminated. Then, a use of that buffer that expects it to be NUL-terminated (i.e., glusterd_store_brickinfopath_set's GLUSTERD_GET_BRICK_DIR) will access beyond the end of the buffer. Instead, diagnose the too-long volume name and fail. Change-Id: I655d8638547bf342d33280c14ff1edacc3cdeb5a BUG: 789278 Signed-off-by: Jim Meyering <meyering@redhat.com> Reviewed-on: http://review.gluster.com/3591 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* nfs-common: don't let 0-length path cause buf[-1] accessJim Meyering2012-07-111-2/+2
| | | | | | | | | Change-Id: I5f0e93448a954aff1ff08a0980fb9bfd60e63988 BUG: 789278 Signed-off-by: Jim Meyering <meyering@redhat.com> Reviewed-on: http://review.gluster.com/3594 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* xlator options: remove overwritten data-self-heal initializerJim Meyering2012-07-111-1/+0
| | | | | | | | | | | | | In the struct volume_options, the "data-self-heal" .default_value = "" setting appeared before a setting of .default_value = "on". Remove the former. Change-Id: Ieddcc18f61581f9448d806cd8bf8eefaaf0118b9 BUG: 789278 Signed-off-by: Jim Meyering <meyering@redhat.com> Reviewed-on: http://review.gluster.com/3589 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* rpc: add extra arguments to _callback's actor functionAmar Tumballi2012-07-115-12/+23
| | | | | | | | | | | | | Need to differentiate the callback functions based on which rpc-clnt the callback is received. without it, all callback actor handling will be like global. BUG: 839345 Change-Id: Ide024f5585eab3c5fe6c3b33250772fb6e8ad655 Signed-off-by: Amar Tumballi <amarts@redhat.com> Reviewed-on: http://review.gluster.com/3656 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* core: remove unused codeAmar Tumballi2012-07-1175-42027/+0
| | | | | | | | | BUG: 764890 Change-Id: Ia8bcaa7a4daeb706bcb0bba24b2e634e9ca20d49 Signed-off-by: Amar Tumballi <amarts@redhat.com> Reviewed-on: http://review.gluster.com/3657 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* xlators/protocol: better filenameAmar Tumballi2012-07-044-3/+4
| | | | | | | | | | | | | | 3_1 name was used for very first version of GlusterFS which used RPC for its protocol, even though we changed protocol after 3.1.x, we kept the name of few files as is. Changed the file names to something better. Change-Id: I297f1979e7c7e909e60674eec2e632506bc776f5 BUG: 764890 Signed-off-by: Amar Tumballi <amarts@redhat.com> Reviewed-on: http://review.gluster.com/3628 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* Gluster Cli:Pressing Control-d hangs gluster cliAmit Chauhan2012-07-041-1/+1
| | | | | | | | | | | | | Gluster Cli hangs on pressing CTRL+d. This happens due to break statement was used when it reads end of stdin. exit statement is used instead of break. Change-Id: I2b0e00c0c5fbe8cb9182a96c06ed052d79845087 BUG: 807563 Signed-off-by: Amit Chauhan <amitchauhan.gfs@gmail.com> Reviewed-on: http://review.gluster.com/3630 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* md-cache: cache SELinux and Posix ACL xattrs only if enabledAnand Avati2012-07-042-5/+60
| | | | | | | | | | | | | | Fetch and cache SELinux and Posix ACL extended attributes only if they are enabled in the command line respectively. Fetching the extra extended attributes is pointless and negatively impacts performance Change-Id: I1bd1dbb1abb4a6929fad5f78bbfeaab8542ab4e2 BUG: 765785 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3538 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* glusterd: copy /etc/glusterd to /var/lib and remove /etc/glusterd instead ofRaghavendra Bhat2012-07-042-2/+3
| | | | | | | | | | | | | | moving * Change default directory from /etc/glusterd to /var/lib/glusterd Change-Id: Iefa82e4fdb94ce5a84dfb40855c80e16e9ffcc40 BUG: 830218 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.com/3548 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* nfs: make NFS filehandles deterministicAnand Avati2012-07-042-151/+6
| | | | | | | | | | | | | The NFS3 file handles now includes just the bare minimum of (ident, exportid, gfid) and removes legacy 'variable' members which are unnecessary since the introduction of GFID backend Change-Id: Iff6e4435d170074b18d208742b48e79b130e2a4d BUG: 835336 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3616 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* cluster/afr: post-op-delay supportAnand Avati2012-07-046-2/+175
| | | | | | | | | | | | | | | | post-op-delay introduces an artificial delay between the OP and POST-OP-CHANGELOG phases of a write transaction to increase the probability of changelog-piggyback and eager-locking to work more efficiently. Also enable eager-locking by default. Change-Id: I865ca4b68512c44818719c7e388952f15d53e6c2 BUG: 836033 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3621 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pranithk@gluster.com>
* cluster/afr: cleanup lk_owner and PID messAnand Avati2012-07-043-41/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Historically PID (frame->root->pid) was used by the locks translator to identify a locker (and make decisions about which locks contend or cooperate/merge). Since the introduction of lock_owner parameter the usage of PID (for locks) was deprecated and is now unused. This patch nukes the usage of PID in AFR The usage of lk_owner has also ended up being a mess, because of the differentiation required between ->lk() and ->inodelk(), (->lk() needs to be identified by the process (roughly) and ->inodelk() needs to be identified by the transaction) and also because of optimizations like eager locking (locks are no more identified by the transaction as they now get inherited by the next transaction). The scheme (and technique) now is: - All FOPs (the third phase of the transaction) happen with the lk_owner which is set by the topmost layer (FUSE, NFS etc.) - All entrylks are issued with lk_owner set to the frame->root address. - Inodelks which will not be subject to eager locking are issued with lk_owner set to frame->root. - Inodelks which are subject to eager locking are issued with lk_owner set to the address of fd_t (which are the only type of frames which get subject to the eager locking optimization) - At the start of the transaction, the transaction frame's lk_owner is set to the either frame->root or fd_t (and never unmodified) depending on the type of transaction. - Just before the third phase (FOP phase) the set lk_owner is "saved" away and overwritten by the lk_owner submitted by the top layer (FUSE or NFS) - Right after the third phase, the saved lk_owner is "restored" to resume the transaction into the POST-OP and eventually UNLOCK using the same lk_owner which was used during the LOCK phase. Change-Id: I6ab8e4d6b65ae4185fa85ad3fded8e9188b2f929 BUG: 836033 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3620 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pranithk@gluster.com>