summaryrefslogtreecommitdiffstats
path: root/xlators
Commit message (Collapse)AuthorAgeFilesLines
* gNFS: correct some typos in comments.Humble Chirammal2014-08-274-8/+8
| | | | | | | | | | Change-Id: I304c760c2318edd4bab985ca19bf9ce62fd21a3c BUG: 1075417 Signed-off-by: Humble Chirammal <hchiramm@redhat.com> Reviewed-on: http://review.gluster.org/8265 Reviewed-by: Santosh Pradhan <spradhan@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Niels de Vos <ndevos@redhat.com>
* glusterd: Add xml specific functions in HAVE_LIB_XML blockHarshavardhana2014-08-261-3/+5
| | | | | | | | | | | | Build failure on OSX and also on Linux with '--disable-xml-output' introduced in following commit "c080403393987f807b9ca81be140618fa5e994f1" Change-Id: I0db92c9f5e319dc1932bed9ecc1acc98adb57de3 BUG: 983317 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/8546 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
* cluster/dht: introduce locking api.Raghavendra G2014-08-265-1/+658
| | | | | | | | | | Change-Id: I41389ba91951d3e63e617aa32cd0bee848261c72 BUG: 1130888 Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-on: http://review.gluster.org/8521 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/changelog: Removal of redundant fop color count while draining.Ajeet Jha2014-08-261-5/+0
| | | | | | | | | Change-Id: Ie5581579df63513e636fa3dd92dd90699ea7d999 BUG: 1128093 Signed-off-by: Ajeet Jha <ajha@redhat.com> Reviewed-on: http://review.gluster.org/8542 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* cli/glusterd: Support of volume get for a specific volume optionAtin Mukherjee2014-08-265-154/+601
| | | | | | | | | | | | | | This patch introduces a cli command to display a specific volume option/all volume options of a specific volume with the following usage: Usage: volume get <VOLNAME> <key|all> Change-Id: Ic88edb33c5509d7a37cd5ade6341e45e3cdbf59d BUG: 983317 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/8305 Reviewed-by: Kaushal M <kaushal@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* features/changelog: Crash consistency of changelog wrt snapshotAjeet Jha2014-08-264-0/+232
| | | | | | | | | | | | | This patch introduces call-path fop details logging for data operations in CHANGELOG.SNAP. This feature is enabled with barrier-enable notification and disabled with barrier-disable notification. Change-Id: Ib548d34203eb99cea478a6baff402e82251c73a4 BUG: 1128093 Signed-off-by: Ajeet Jha <ajha@redhat.com> Reviewed-on: http://review.gluster.org/8533 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* cluster/afr: Fix all locked_on bricks are sinks check in self-healsPranith Kumar K2014-08-265-82/+66
| | | | | | | | | | | | | | | | | | | | Problem: Counts may give wrong results when the number of bricks is > 2. If the locks are acquired on one source and sink, but the source accuses even the down sink then there will be 2 sinks and lock is acquired on 2 bricks so even when there is a clear source and sink **_finalize_source functions think the file/directory is in split-brain. Fix: Check that all the bricks which are locked are sinks. Change-Id: Ia43790e8e1bfb5e72a3d0b56bcad94abd0dc58ab BUG: 1128721 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8456 Reviewed-by: Ravishankar N <ravishankar@redhat.com> Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* Fix glustershd detection on volume restartEmmanuel Dreyfus2014-08-251-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | On NetBSD and FreeBSD, doing a 'gluster volume start $volume force' causes NFS server, quotad, snapd and glustershd to be undetected by glusterd once the volume has restarted. 'gluster volume status' shows the three processes as 'N' in the online column, while they have been launched successfully. This happens because glusterd attempts to connect to its child processes just between the child does a unlink() on the socket in __socket_server_bind() and the time it calls bind() and listen(). Different scheduling policy may explain why the problem does not happen on Linux, but it may pop up some day since we make no guaranteed assumptions here. This patchet works this around by introducing a boolean transport.socket.ignore-enoent option, set by nfs and glustershd, which prevents ENOENT to be fatal and cause glusterd to retry and suceed later. Behavior of other clients is unaffected. BUG: 1129939 Change-Id: Ifdc4d45b2513743ed42ee235a5c61a086321644c Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8403 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* mount/fuse: Handle fd resolution failuresPranith Kumar K2014-08-254-187/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Even when the fd resolution failed, the fop is continuing on the new graph which may not have valid inode. This lead to NULL layout subvols in dht which lead to crash in fsync after graph migration. Fix: - Remove resolution error handling in FUSE_FOP as it was only added to handle fd migration failures. - check in fuse_resolve_done for fd resolution failures and fail the fop right away. - loc resolution failures are already handled in the corresponding fops. - Return errno from state->resolve.op_errno in resume functions. - Send error to fuse on frame allocation failures. - Removed unused variable state->resolved - Removed unused macro FUSE_FOP_COOKIE Change-Id: I479d6e1ff2ca626ad8c8fcb6f293022149474992 BUG: 1126048 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8402 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/changelog: barrier all entry creation fopsVijay Bellur2014-08-251-27/+308
| | | | | | | | | | | | | | | | | | | when a snapshot is taken, there are chances of entry creation fops not being recorded either in changelog or through the recursive ancestry xtime updation by marker. This causes consumers of changelog (primarily geo-replication as of today) to not be aware of these entries after a snapshot is restored. This can lead to inconsistencies. This patch is an interim workaround to barrier creates till changelog becomes completely crash consistent. BUG: 1128093 Change-Id: Ie0dbfd74beecb88df5c2ddf9fc680af91547c3f3 Signed-off-by: Vijay Bellur <vbellur@redhat.com> Reviewed-on: http://review.gluster.org/8517 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: ajeet jha <ajha@redhat.com> Reviewed-by: Aravinda VK <avishwan@redhat.com> Reviewed-by: Kotresh HR <khiremat@redhat.com>
* Cluster/DHT : Additional log messagesNithya Balachandran2014-08-242-5/+8
| | | | | | | | | | | | Adding log messages in the rename and lookup calls to help with debugging. Change-Id: I13b1c6f98fb49ead45362550c46359ab1f9028c0 BUG: 1130888 Signed-off-by: Nithya Balachandran <nbalacha@redhat.com> Reviewed-on: http://review.gluster.org/8516 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* cluster/afr: Perform metadata sync inside metadata locksPranith Kumar K2014-08-221-19/+15
| | | | | | | | | Change-Id: Ie55b3d37cacbdad74a3f63c3b0f025b0ffd0104a BUG: 1132461 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8514 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
* cluster/afr: Perform gfid heal inside locks.Pranith Kumar K2014-08-226-27/+69
| | | | | | | | | | | | | | | | | Problem: Allowing lookup with 'gfid-req' will lead to assigning gfid at posix layer. When two mounts perform lookup in parallel that can lead to both bricks getting different gfids leading to gfid-mismatch/EIO for the lookup. Fix: Perform gfid heal inside lock. BUG: 1129529 Change-Id: I20c6c5e25ee27eeb906bff2f4c8ad0da18d00090 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8512 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
* client: client3_3_readdir() - initialize ``local`` properlyHarshavardhana2014-08-221-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A crash is observed in the following scenario on OSX ~~~ (gdb) p readdir_rsp_size $1 = 1552 GLUSTERFS_RPC_REPLY_SIZE == 24 GLUSTERFS_RDMA_MAX_HEADER_SIZE == 228 ((1552 + 24 + 228)) == 1804 GLUSTERFS_RDMA_INLINE_THRESHOLD == 2048 if ((readdir_rsp_size + GLUSTERFS_RPC_REPLY_SIZE + GLUSTERFS_RDMA_MAX_HEADER_SIZE) > GLUSTERFS_RDMA_INLINE_THRESHOLD) ----> False ~~~ ``local`` is never initialized leads to NULL reference later. This patch makes sure that local is initialized, correctly as its done in client3_3_readdirp() call. Change-Id: I46931fc96900b7740ae71536c954bb9deda5c879 BUG: 1132796 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/8511 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* glusterd/snapshot : Fail the snapshot create operation if geo-rep is running.Sachin Pandit2014-08-211-1/+11
| | | | | | | | | | | | | | | | | As one of the recommandations for taking a snapshot is not to have an active geo-replication session, its better to display an error saying session is active when snapshot create command is issued. Change-Id: I94593dbd2659610e033ca316176dda1ac8dc5ce6 BUG: 1129038 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/8461 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* cluster/afr: Set pending changelog based on filetype for new entriesPranith Kumar K2014-08-211-4/+12
| | | | | | | | | Change-Id: Ib6eea2dfe43aacf1f3446cc023adecbcf8645d48 BUG: 1132102 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8506 Reviewed-by: Anuradha Talur <atalur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* geo-rep/glusterd: API to check active geo-rep session for the volumeKotresh H R2014-08-214-67/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | Requirement: Snapshot needs an API to fail the CLI if any geo-rep session is active for that volume. Solution: A function "gd_vol_is_geo_rep_active" is provided to check if any geo-rep session is active for that volume. An in memory dict called 'gsync_running_slaves' is maintained in 'volinfo' structure to keep track of active geo-rep session for the volume. The key 'slavenode::slavevol' with value 'running' is added whenever geo-rep is started/resumed into the dict and the same is removed if stopped/paused. So the 'count' in dict is used to decide whether the geo-rep is active or not for that volume. Also added "this->name" in gf_log in routines which this patch is touched. Change-Id: I2b5de7dd686541c6b89c0fd0f7a4dbc92eecfac5 BUG: 1129008 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/8459 Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* client: Add ping-timeout to statedumpKrishnan Parthasarathi2014-08-191-11/+14
| | | | | | | | | | | | | | | The ping timeout value of a client xlator can be seen by, ># cat $META/graphs/active/vol-client-0/private |grep ping_timeout ping_timeout = 42 where $META is /<fuse-mountpt>/.meta Change-Id: I4f68f184fc3f30871269a23fc4a82a1378396058 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/8321 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* NFS: stripe-xlator should pass EOF at end of READDIRNiels de Vos2014-08-191-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | NFS READDIR replies are made of a header, a sequence of entries, and a EOF flag. When GlusterFS's NFS server is used along with stripe xlator, it fails to set the EOF flag, which violates NFS RFC and confuses some clients. The bug is caused because nfs xlator sets EOF if it gets op_errno set to ENOENT. That value is produced in storage xlator and propagated through server, client, and other xlators until stripe xlator handles it. stripe only passed op_errno if op_ret < 0, which is not the case here. This change set adds a special case for that situation to fix the problem. Change-Id: Ie6db94b0515292387cfb04c1e4a9363f34fcd19a BUG: 1130969 Reported-by: Emmanuel Dreyfus <manu@netbsd.org> Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/8493 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Santosh Pradhan <spradhan@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org> Tested-by: Emmanuel Dreyfus <manu@netbsd.org>
* cluster/dht: Fix dht_access treating directory like filesShyam2014-08-181-4/+5
| | | | | | | | | | | | | | | | | | | | | | | When the cluster topology changes due to add-brick, all sub volumes of DHT will not contain the directories till a rebalance is completed. Till the rebalance is run, if a caller bypasses lookup and calls access due to saved/cached inode information (like NFS server does) then, dht_access misreads the error (ESTALE/ENOENT) from the new subvolumes and incorrectly tries to handle the inode as a file. This results in the directories in memory state in DHT to be corrupted and not heal even post a rebalance. This commit fixes the problem in dht_access thereby preventing DHT from misrepresenting a directory as a file in the case presented above. Change-Id: Idcdaa3837db71c8fe0a40ec0084a6c3dbe27e772 BUG: 1125824 Signed-off-by: Shyam <srangana@redhat.com> Reviewed-on: http://review.gluster.org/8462 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* cluster/dht: Added keys in dht_lookup_everywhere_doneVenkatesh Somyajulu2014-08-141-4/+72
| | | | | | | | | | | | | | | | | | | Case where both cached (C1) and hashed file are found, but hash does not point to above cached node (C1), then dont unlink if either fd-is-open on hashed or linkto-xattr is not found. Change-Id: I7ef49b88d2c88bf9d25d3aa7893714e6c0766c67 BUG: 1116150 Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com> Change-Id: I86d0a21d4c0501c45d837101ced4f96d6fedc5b9 Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com> Reviewed-on: http://review.gluster.org/8429 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: susant palai <spalai@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* NetBSD /dev/fuse detectionEmmanuel Dreyfus2014-08-131-0/+4
| | | | | | | | | | | | | | NetBSD's FUSE being pure userland implementation, there is no /dev/fuse to open. Test /dev/puffs (kernel fs-in-userland subsystem supporting FUSE) insead. BUG: 764655 Change-Id: Ia65e95c246dc31ea2839cf64d7c851430828542e Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8478 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* glusterd: Coverity fix for going out of scope leaks of directory pointerggarg2014-08-131-0/+2
| | | | | | | | | | | | | | | | In function volgen_apply_filters() directory stream associated with "filterdir" should be close after opening directory stream corresponding to directory name. closedir() also closes the underlying file descriptor associated with "filterdir". Coverity CID: 1124723 Change-Id: I78ed04047ded98bf95d201afed01c727aa506882 BUG: 789278 Reviewed-on: http://review.gluster.org/8088 Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
* cluster/afr: Fix mem-leakPranith Kumar K2014-08-111-2/+5
| | | | | | | | | | | | | | | | | | Problem: local->xattr_req is already reffed with xattr_req that comes in lookup fop. But when afr_lookup_xattr_req_prepare is called local->xattr_req is over-written with dict_new() which leads to ref leak on the dict which came in lookup fop Fix: Create local->xattr_req only when it is NULL Change-Id: Ib1548f2df97688859f2cace44b93b3b733297c36 BUG: 1128801 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8457 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* osx: Enable qemu feature build on DarwinHarshavardhana2014-08-111-1/+2
| | | | | | | | | 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>
* Always build EC xlatorEmmanuel Dreyfus2014-08-101-1/+1
| | | | | | | | | | | | 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>
* osx: snapview-server fails to build on OSX use 'syscall.h'Harshavardhana2014-08-091-0/+1
| | | | | | | | Change-Id: I29aeb32a972ed6d19e779b9e79fce9a489848497 BUG: 1089172 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/8436 Tested-by: Gluster Build System <jenkins@build.gluster.com>
* mount: Verify mount failure in mount.glusterfs wrapper.Humble Chirammal2014-08-081-0/+5
| | | | | | | | | | | | The result of mount command execution is not checked properly, thus no proper message given for the end user. This patch fix the same. Bug Id: 1128165 Change-Id: I3882e34e840ed15b5ce48ed5e1ad51208e2be913 Signed-off-by: Humble Chirammal <hchiramm@redhat.com> Reviewed-on: http://review.gluster.org/8438 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* build: make GLUSTERD_WORKDIR rely on localstatedirHarshavardhana2014-08-0711-26/+18
| | | | | | | | | | | | | | | | | | | | | | - 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>
* feature/geo-rep: Keep marker.tstamp's mtime unchangeable during snapshot.Kotresh H R2014-08-043-13/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Geo-replicatoin does a full xsync crawl after snapshot restoration of slave and master. It does not do history crawl. Analysis: Marker creates 'marker.tstamp' file when geo-rep is started for the first time. The virtual extended attribute 'trusted.glusterfs.volume-mark' is maintained and whenever it is queried on gluster mount point, marker fills it on the fly and returns the combination of uuid, ctime of marker.tstamp and others. So ctime of marker.tstamp, in other sense 'volume-mark' marks the geo-rep start time when the session is freshly created. From the above, after the first filesystem crawl(xsync) is done during first geo-rep start, stime should always be less than 'volume-mark'. So whenever stime is less than volume-mark, it does full filesystem crawl (xsync). Root Cause: When snapshot is restored, marker.tstamp file is freshly created losing the timestamps, it was originally created with. Solution: 1. Change is made to depend on mtime instead of ctime. 2. mtime and atime of marker.tstamp is restored back when snapshot is created and restored. Change-Id: I4891b112f4aedc50cfae402832c50c5145807d7a BUG: 1125918 Signed-off-by: Kotresh H R <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/8401 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* geo-rep/libgfchangelog: Support of symlinks while creation of working dir.Kotresh H R2014-08-041-1/+1
| | | | | | | | | | | | | In gf_changelog_register, enable symlink support while creating working directory if its not already created. Change-Id: I4b81762d04f5276a65087d2ff94f2a36dc504b58 BUG: 1125843 Signed-off-by: Kotresh H R <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/8409 Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: Venky Shankar <vshankar@redhat.com>
* glusterd/snapshot: Inherit the mount options of a original brickVijaikumar M2014-08-037-122/+250
| | | | | | | | | | | | | | | | | | | | when creating snapshots When creating a snapshot a LVM is created at the backend and is mounted under /var/run/gluster/snaps/... However, this mount does not inherit the mount options for the original brick acting as the parent for the snap. If the snap is restored, this could lead to performance degredations, functional limitations, or in extreme scenarios even potential data loss. Change-Id: I67d70fd83430d83dacc5380c6c928e27fb9c9e1b BUG: 1125180 Signed-off-by: Vijaikumar M <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/8394 Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* cluster/ec: Fix incorrect management of NFS requestsXavier Hernandez2014-08-023-89/+51
| | | | | | | | | | | | | | | | | | | Some operations, specially those comming from NFS, do not use a regular fd and use an anonymous fd (i.e. a previous open call has not been sent). Any context information created during open or create will not be present on these fd's, so we simply return NULL for contexts of those fd. Also it seems that NFS can send write requests with a very big buffer (higher that the default value of 128 KB). Some changes have been made to correctly handle these large buffers. Change-Id: I281476bd0d2cbaad231822248d6a616fcf5d4003 BUG: 1122417 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/8367 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* geo-rep/libgfchangelog: Create working dir during changelog_register if not ↵Kotresh H R2014-08-011-6/+15
| | | | | | | | | | | | | | | | | | | present. Earlier, xysnc's register was being called first, which was creating working directory before calling changelog_register. Now it is history crawl first. Hence working directory would not have been created. Create it in gf_changelog_register itself if it is not already created. Change-Id: Ief3f2b87deaf5da16c135b64be1be42e0a7647f3 BUG: 1125843 Signed-off-by: Kotresh H R <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/8399 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Aravinda VK <avishwan@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* storage/posix: fix issue in posix_fsyncZhang Huan2014-08-011-1/+2
| | | | | | | | | | | | | | Fix the issue that posix_fsync does not correctly return and save error code in op_errno when call to sys_fdatasync fails. Change-Id: Id0b62cfa009dbb52c8a0992abd5c46330fa0a8c0 BUG: 1125814 Signed-off-by: Zhang Huan <zhhuan@gmail.com> Reviewed-on: http://review.gluster.org/8398 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Santosh Pradhan <spradhan@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* cluster/dht: Modified logic of linkto file deletion on non-hashedVenkatesh Somyajulu2014-07-313-23/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently whenever dht_lookup_everywhere gets called, if in dht_lookup_everywhere_cbk, a linkto file is found on non-hashed subvolume, file is unlinked. But there are cases when this file is under migration. Under such condition, we should avoid deletion of file. When some other rebalance process changes the layout of parent such that dst_file (w.r.t. migration) falls on non-hashed node, then may be lookup could have found it as linkto file but just before unlink, file is under migration or already migrated In such cased unlink can be avoided. Race: ------- If we have two bricks (brick-1 and brick-2) with initial file "a" under BaseDir which is hashed as well as cached on (brick-1). Assume "a" hashing gives 44. Brick-1 Brick-2 Initial Setup: BaseDir/a BaseDir [1-50] [51-100] Now add new-brick Brick-3. 1. Rebalance-1 on node Node-1 (Brick-1 node) will reset the BaseDir Layout. 2. After that it will perform a) Create linkto file on new-hashed (brick-2) b) Perform file migration. 1.Rebalance-1 Fixes the base-layout: Brick-1 Brick-2 Brick-3 --------- ---------- ------------ BaseDir/a BaseDir BaseDir [1-33] [34-66] [67-100] 2. Only a) is BaseDir/a BaseDir/a(linkto) BaseDir performed Create linktofile Now rebalance 2 on node-2 jumped in and it will perform step 1 and 2-a. After (rebal-2, step-1), it changes the layout of the BaseDir. BaseDir/a BaseDir/a(link) BaseDir [67-100] [1-33] [34-66] For (rebale-2, step-2), It will perform lookup at Brick-3 as w.r.t new layout 44 falls for brick-3. But lookup will fail. So dht_lookup_everywhere gets called. NOTE: On brick-2 by rebalance-1, a linkto file was created. Currently that linkto files gets deleted by rebalance-2 lookup as it is considered as stale linkto file. But with patch if rebalance is already in progress or rebalance is over, linkto file will not be unlinked. If rebalance is in progress fd will be open and if rebalance is over then linkto file wont be set. Change-Id: I3fee0d28de3c76197325536a9e30099d2413f079 BUG: 1116150 Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com> Reviewed-on: http://review.gluster.org/8345 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* ec: Add -msse2 option to avoid fedora/rawhide compilation errorsXavier Hernandez2014-07-311-1/+1
| | | | | | | | | | | | | | | | | This solves a compilation error on some compiler versions. To avoid compilation issues on non-Intel architectures, patch http://review.gluster.org/8366/ has already been merged. It disables ec on those architectures. These modifications are temporary patches until a proper solution for bug #1125166 is ready. Change-Id: I74d0b79e84601cc4f86ad08ce0f8102b99a79a68 BUG: 1125168 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/8395 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* Symlink mtime changes when rebalancingAnders Blomdell2014-07-311-1/+2
| | | | | | | | | | | | | Added mtime preservation for special files during rebalance. Change-Id: If04921d4d66853fde8b4d8a3ab748790864f8f42 BUG: 1122443 Signed-off-by: Anders Blomdell <anders.blomdell@control.lth.se> Reviewed-on: http://review.gluster.org/8383 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-by: Anand Avati <avati@redhat.com>
* client/rpc: Add ping and msgs statsKrishnan Parthasarathi2014-07-311-0/+4
| | | | | | | | | | | | | | | | | | | This can be seen as below, ># cat $META/graphs/active/vol-client-0/private |grep ping_msgs_sent ping_msgs_sent = 2 ># cat $META/graphs/active/vol-client-0/private |grep "^msgs_sent" msgs_sent = 13 where $META is /<fuse-mountpt>/.meta Change-Id: I2107ec2b045bac701377760635e18758adb943a3 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/8285 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* build: fix compile issue in unittest on EPEL-5Niels de Vos2014-07-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* cluster/afr: Improve inodelk/entrylk failure log messagesKrutika Dhananjay2014-07-302-7/+18
| | | | | | | | | | | 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>
* glusterd: Error msg for snapshot status for no existing snapsVijaikumar M2014-07-301-35/+42
| | | | | | | | | | | | | | | | | 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>
* glusterd/snapshot: Proper err msg for snapshot create commandRajesh Joseph2014-07-301-0/+77
| | | | | | | | | | | | | | | 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>
* dht: fix rename raceNithya Balachandran2014-07-301-2/+5
| | | | | | | | | | | | | 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>
* storage/posix: removing deleting entries in case of creation failuresRaghavendra G2014-07-304-41/+91
| | | | | | | | | | | | | 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>
* Allow gluster to be used with linux automounterAnders Blomdell2014-07-271-1/+4
| | | | | | | | | | | | | 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>
* rpc,glusterd: Set ret to 0 after call to rpc_clnt_submit()Krutika Dhananjay2014-07-271-3/+10
| | | | | | | | | | | | | | | | | 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>
* Attempt to fix cmockery2 buildEmmanuel Dreyfus2014-07-271-1/+1
| | | | | | | | | | | | | | | | | | | 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>
* feature/snapshot : Interface to delete all snapshots belongingSachin Pandit2014-07-251-25/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* glusterd: update volinfo->subvol_count during remove-brick operation.Ravishankar N2014-07-241-2/+2
| | | | | | | | | | | | | | | | | | Problem: In glusterd_op_remove_brick(), volinfo->subvol_count was getting updated only if the replica count was reduced due to which subvol_matcher_verify() gave false errors under certain scenarios (see bug description). Fix: updated subvol_count for every remove-brick operation. Change-Id: Id72691e2bda1c624cd7d8cae92f6bf32c101a6d3 BUG: 1120647 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/8326 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com>