summaryrefslogtreecommitdiffstats
path: root/xlators/features
Commit message (Collapse)AuthorAgeFilesLines
* USS: initialize a list before using it.Raghavendra G2014-09-021-1/+3
| | | | | | | | | Change-Id: Iba35e4397646a67384e878fbe7bdfb7586fc07f9 BUG: 1130888 Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-on: http://review.gluster.org/8569 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* porting: various fixes regression tests OSX/FreeBSDHarshavardhana2014-08-291-1/+1
| | | | | | | | | | | | | | | | | | | | - `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>
* 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>
* 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>
* 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>
* 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>
* 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>
* build: make GLUSTERD_WORKDIR rely on localstatedirHarshavardhana2014-08-072-4/+3
| | | | | | | | | | | | | | | | | | | | | | - 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-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* 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>
* features/changelog: Capture "correct" internal FOPsVenky Shankar2014-07-231-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes changelog capturing internal FOPs in a cascaded setup, where the intermediate master would record internal FOPs (generated by DHT on link()/rename()). This is due to I/O happening on the intermediate slave on geo-replication's auxillary mount with client-pid -1. Currently, the internal FOP capturing logic depends on client pid being non-negative and the presence of a special key in dictionary. Due to this, internal FOPs on an inter-mediate master would be recorded in the changelog. Checking client-pid being non-negative was introduced to capture AFR self-heal traffic in changelog, thereby breaking cascading setups. By coincidence, AFR self-heal daemon uses -1 as frame->root->pid thereby making is hard to differentiate b/w geo-rep's auxillary mount and self-heal daemon. Change-Id: Ib7bd71e80dd1856770391edb621ba9819cab7056 BUG: 1122037 Original-Author: Venky Shankar <vshankar@redhat.com> Signed-off-by: Kotresh H R <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/8347 Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/marker: Fill loc->path before sending the control to healingVarun Shastry2014-07-222-24/+42
| | | | | | | | | | | | | | | | | Problem: The xattr healing part of the marker requires path to be present in the loc. Currently path is not filled while triggering from the readdirp_cbk. Solution: Current patch tries to fill the loc with path. Change-Id: I5c7dc9de60fa79ca0fe9b58d2636fd1355add0d3 BUG: 1118591 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/8296 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* build: add libraries to LIBADD instead of LDFLAGSTiziano Müller2014-07-191-2/+2
| | | | | | | | | | | | | | | For a number of linker flags the order of the object files and the libs to link against matter (for example -Wl,--as-needed). Make sure that libraries are added via the LIBADD variable instead of LDFLAGS and therefore always come after the object files. Change-Id: I59d114752a0c7664b8678a72082ba5e445497fe5 Signed-off-by: Tiziano Müller <tiziano.mueller@stepping-stone.ch> Reviewed-on: http://review.gluster.org/8331 Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-by: Prashanth Pai <ppai@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/gfid-access: Print real-gfid in statedumpPranith Kumar K2014-07-181-0/+24
| | | | | | | | | | Change-Id: I1cac8f3ccfcf1fda64ff8470d4f2000d05dcab63 BUG: 1117733 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8271 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kotresh HR <khiremat@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* make snapview-server more compatible with NFS serverRaghavendra Bhat2014-07-162-78/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * There was no handle based API for listxattr. With this change, glfs_h_getxattrs also handles the listxattr functionality by checking whether the name is NULL or not (like posix). But all the gfapi functions for listxattr (glfs_h_getxattrs AND glfs_listxattr AND glfs_flistxattr) returns the names of the xattrs in a buffer provided by the caller. But snapview-server has to return the list of xattrs in a dict itself (similar to posix xlator). But the buffer just contains the names of the xattrs. So for each xattr, a zero byte value is set (i.e. "") into the dict and sent back. Translators which do xattr caching (as of now md-cache which caches selinux and acl related xattrs) should not cache those xattrs whose value is a zero byte data (""). So made changes in md-cache to ignore zero byte values. * NFS server was not linking the inodes to inode table in readdirp. This was leading to applications getting errors. The below set of operations would lead to applications getting error 1) ls -l in one of the snaopshots (snapview-server would generate gfids for each entry on the fly and link the inodes associated with those entries) 2) NFS server upon getting readdirp reply would not link the inodes of the entries. But it used to generate filehandles for each entry and associate the gfid of that entry with the filehandle and send it as part of the reply to nfs client. 3) NFS client would send the filehandle of one of those entries when some activity is done on it. 4) NFS server would not be able to find the inode for the gfid present in the filehandle (as the inode was not linked) and would go for hard resolution by sending a lookup on the gfid by creating a new inode. 5) snapview-client will not able to identify whether the inode is a real inode existing in the main volume or a virtual inode existing in the snapshots as there would not be any inode context. 6) Since the gfid upon which lookup is sent is a virtual gfid which is not present in the disk, lookup would fail and the application would get an error. To handle above situation, now nfs server also does inode linking in readdirp. Change-Id: Ibb191408347b6b5f21cff72319ccee619ea77bcd BUG: 1115949 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/8230 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* compress: Change variable nameHumble Chirammal2014-07-151-8/+8
| | | | | | | | | | | | | 'writen' and 'total_writen' variables has been defined in compress xlator. This patch replaced those with proper name. Change-Id: If8e38fae8f997a92686a891d64cbaf6b0b69129a BUG: 1075417 Signed-off-by: Humble Chirammal <hchiramm@redhat.com> Reviewed-on: http://review.gluster.org/8268 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com>
* gfapi : remove gfapi.py to avoid confusionHumble Chirammal2014-07-142-1/+1
| | | | | | | | | | | | | | | | | | | | 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>
* changelog: variable 'writen' is changedHumble Chirammal2014-07-144-12/+12
| | | | | | | | | | | | | This patch change the variable name to 'written' in changelog, along with few other typo fixing. Change-Id: I1d3cbea5c89fc0a15233bb6e61b4fbd4bfdd3a67 BUG: 1075417 Signed-off-by: Humble Chirammal <hchiramm@redhat.com> Reviewed-on: http://review.gluster.org/8267 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com>
* features/gfid-access: error handling for entry creationVenky Shankar2014-07-141-1/+7
| | | | | | | | | | | | | | | | | | | | | | | Proceed with setattr() only on a successfull entry creation. Winding a setattr() using a freshlyOC initiated inode would most likely fail in one translator or the other (e.g. DHT expecting the layout information to be set in the inode context), which is the case if the inode was not looked up. Therefore, gfid-access handles failure entry creations and passes the _correct_ errno back to the client instead of continuing with setattr() call and probably returning back incorrect errno. Also, filling up inode->gfid is required as the new inode is not looked up and ->gfid would be certainely required for inode operations. Change-Id: Ie92f5647a89bf558c07710ab0400bce69d59fc31 BUG: 1111490 Signed-off-by: Venky Shankar <vshankar@redhat.com> Reviewed-on: http://review.gluster.org/8260 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kotresh HR <khiremat@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/changelog: prevent deadlock on thread cancellationVenky Shankar2014-07-111-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | helper threads (fsync, rollover) wake up periodically and perform their respective operation under a lock (crt->lock). These threads are also subjected to cancellation under some circumstance such as disabling changelog. This is inherently dangerous when funtions which are cancellation points for pthread_cancel(3) are used in the locked region. Consider this pthread_mutex_lock(&mutex); { /* ... */ ret = fsync (fd); <-- cancellation point /* ... */ } pthread_mutex_unlock(&mutex); A pthread_cancel(3) by another thread just before fsync(3) but after pthread_mutex_lock(3) would result in the thread getting cancelled when fsync(3) is invoked, thereby never unlocking the mutex. Moreover, in case of changelog translator, the locked region (under crt->lock in changelog-rt.c) is also the code path for fop changelog updation. Therefore, unlocking the mutex in thread cleanup handler (pthread_cleanup_pop(3)) might prematurely release the mutex during fop updation path. This patch fixes such problems existing in fsync and rollover threads. Fix is to enter the locked region with cancellation disabled and enable it after mutex unlock. Also, test for a cancellation request early on in case none of the functions are cancellation points. Change-Id: I1795627a12827609c1da659d07fc1457ffa033de BUG: 1110917 Signed-off-by: Venky Shankar <vshankar@redhat.com> Reviewed-on: http://review.gluster.org/8106 Reviewed-by: Kotresh HR <khiremat@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* Changes in statedump for stack, frame, locksPranith Kumar K2014-07-071-42/+55
| | | | | | | | | | | | | | | | | | | | | | | | Internal call-stacks don't have lk-owner so it is a bit difficult to confirm if a stack hung by comparing two statedump files. This change prints call-stack, frame's address. This should solve the comparison problem. Lock times and log times don't have same timezone because of which one has to manually convert the times for debugging the issues. This change prints blocked, granted times also in UTC. Also fixed line truncation issue when client-unique-string is big. Change-Id: I116372c0d63476823a36ca6dbfba91648f9234cc BUG: 1114188 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8197 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Ravishankar N <ravishankar@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/gfid-access: Fix entry operationsPranith Kumar K2014-07-061-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: When more than one aux-mounts are performing rmdir .gfid/<pargfid>/dir simultaneously, then sometimes a hang is observed. In gfid-access xlator When virtual parent/inode are replaced with real parent/inode in loc, virtual pargfid/gfid are not replaced with real pargfid/gfid respectively. Afr is using parent_loc->gfids to order the entry locks. But parent_loc->gfid contains random/virtual gfid generated by gfid-access xlator. Entrylk in client xlator is using loc->inod->gfid for sending entrylk which has 'real' gfid. Because the ordering is happening based on random gfids, One mount orders the locks as (L1, L2) where as the other orders them as (L2, L1) leading to a dead-lock thus a hang. Fix: Replace virtual pargfid/gfid with real pargfid/gfid when virtual-inodes are replaced with real-inodes in loc. BUG: 1114501 Change-Id: Ie94e816122ef9e7aad51605adbf49291de60827e Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8204 Reviewed-by: Kotresh HR <khiremat@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com>
* porting: Port for FreeBSD rebased from Mike Ma's effortsHarshavardhana2014-07-022-24/+26
| | | | | | | | | | | | | | | | | | | - 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>
* feature/changelog: Fix for missing changelogs at backend.Kotresh H R2014-06-302-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: A few changelog files are missing at the backend during snapshot with changelog enabled. Cause: Race between actual rollover and explicit rollover. Changelog rollover can happen either due to actual or the explict rollover due to snapshot. Actual rollover is controlled by tuneable called rollover-time. The minimum granularity for rollover-time is 1 second Explicit rollover is asynchronous in nature and happens during snapshot. Basically, rollover renames the current CHANGELOG file to CHANGELOG.TIMESTAMP after rollover-time. Let's assume, at time 't1', actual and explicit rollover raced against each other and actual rollover won the race renaming the CHANGELOG file to CHANGELOG.t1 and opens a new CHANGELOG file. An immediate explicit rollover at time 't1' happened with in the same second to rename CHANGELOG file to CHANGELOG.t1 resulting in purging the earlier CHANGELOG.t1 file created by actual rollover. Solution: Adding a delay of 1 sec guarantees unique CHANGELOG.TIMESTAMP during explicit rollover. Thanks Venky, for the all the help in root causing the issue. Change-Id: I8958824e107e16f61be9f09a11d95f8645ecf34d BUG: 1109692 Signed-off-by: Kotresh H R <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/8196 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com>
* quotad: Remove dead codePranith Kumar K2014-06-302-11/+1
| | | | | | | | | | | | | | client_t is created by server xlator for managing connection related resources. Quotad doesn't do that. So no need to handle anything related to it. Change-Id: I83e6f9e1c57458d60529dc62086bb63642932d49 BUG: 1113403 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8180 Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/gfid-access: Handle loc modification correctly for virtual dirsPranith Kumar K2014-06-302-120/+142
| | | | | | | | | | Change-Id: I6e3321534dc2f711519b18e8bffb691ab952a8ba BUG: 1112659 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8163 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/snapview-client: put local back to mempool after unwindRaghavendra Bhat2014-06-231-1/+3
| | | | | | | | | Change-Id: I3a709a835b21edf757ee5a1cd04cd9d1c59201dc BUG: 1111552 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/8128 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/changelog: Fix for history api issue during upgradeAjeet Jha2014-06-221-27/+26
| | | | | | | | | | | | | | | On failure during history changelog availability check, there was an attempt to destory attribute (of consume thread) which was not initialised. Change-Id: Ica7a98ee70eb1303303884b01ef76ab71430a351 BUG: 1111169 Signed-off-by: Ajeet Jha <ajha@redhat.com> Reviewed-on: http://review.gluster.org/8118 Reviewed-by: Kotresh HR <khiremat@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com>
* features/index: Don't delete current xattrop index.Ravishankar N2014-06-201-0/+13
| | | | | | | | | | | | Delete the base entry in indices/xattrop only when it is stale. Change-Id: I675c1510dd8293d068e31b552b0de48f50aac658 BUG: 1101647 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/8119 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>
* feautre/gfid-access: Fix EINVAL when stat on .gfidKotresh H R2014-06-202-14/+45
| | | | | | | | | | | | | | | | | | | Problem: Some of the inode operations on '.gfid' virtual directory was resulting in the error EINVAL from dht after failing to find the layout. Solution: Inode operations on '.gfid' virtual directory should not wind further down and should be handled accordingly in the gfid-access translator itself. Change-Id: I156cb10ffea0c46b0d747e26f74538d7fb01a1dd BUG: 1105891 Signed-off-by: Kotresh H R <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/8011 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/quota: Fix dict leakVarun Shastry2014-06-181-0/+3
| | | | | | | | | | Change-Id: I971a52163c0f1a887bbb8585cd69df2339af51cb BUG: 1110777 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/8102 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* snapview/server: warning cleanup after clang complaintsHarshavardhana2014-06-171-10/+2
| | | | | | | | | | | | | | | - svs_inode_new()/svs_fd_new() should only need "no" arguments as presented - define variables only with usability :-) Change-Id: I10a8d189a088701b29f26b6e4913560e32d16e75 BUG: 1089172 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/7998 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Minor fixes for correcting the goto statements for frame destroy and ↵Anand Subramanian2014-06-161-24/+68
| | | | | | | | | | | | | | | | checking pthread_mutex_lock return values * Also some coverity fixes Signed-off-by: Anand Subramanian <anands@redhat.com> Change-Id: I0c27b913e62b0a072e508e37a3fb3421a9ca9503 BUG: 1105439 Signed-off-by: Anand Subramanian <anands@redhat.com> Reviewed-on: http://review.gluster.org/8071 Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/changelog: Do not ignore self-heal fops in changelogKotresh H R2014-06-162-5/+7
| | | | | | | | | | | | | | | | | | Problem: Geo-rep fails to sync some files to slave as the changelog entries are missing for those files. Cause: Fops happened when the active brick is down and self- healed later when it came up. Solution: Capture self-heal fops as well in changelog so those entries are not missed. Change-Id: Ibc288779421b5156dd1695e529aba0b602a530e0 BUG: 1109692 Signed-off-by: Kotresh H R <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/8070 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Get snapshot info dynamically via new rpc and infra for snapview-server to ↵Anand Subramanian2014-06-154-91/+603
| | | | | | | | | | | refresh snaplist BUG: 1105439 Change-Id: I4bb312a53d88f6f4955e69a3ef2b4955ec17f26d Signed-off-by: Anand Subramanian <anands@redhat.com> Reviewed-on: http://review.gluster.org/8001 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* get the path from the loc->path in the lookup instead of resolver doing itRaghavendra Bhat2014-06-131-1/+19
| | | | | | | | | Change-Id: I7448e1199f4fd32fb0ae127b36dcf06641a153a9 BUG: 1108887 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/8053 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* feature/changelog: Fix compilation warning 'set but not used'Kotresh H R2014-06-121-2/+1
| | | | | | | | | | Change-Id: I37de39aec341fbde9516aa8f8c963b70bd808bac BUG: 1108034 Signed-off-by: Kotresh H R <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/8035 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>
* Core: Fix issues reported by CppcheckLalatendu Mohanty2014-06-121-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed in this patch: [glusterfs/extras/geo-rep/gsync-sync-gfid.c:105]: (error) Resource leak: fp [glusterfs/libglusterfs/src/xlator.c:651]: (error) Uninitialized variable: gfid [glusterfs/libglusterfs/src/xlator.c:652]: (error) Uninitialized variable: gfid [glusterfs/xlators/cluster/ha/src/ha.c:2699]: (error) Possible null pointer dereference: priv [glusterfs/xlators/features/changelog/src/changelog.c:1464]: (error) Possible null pointer dereference: priv [glusterfs/xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c:865]: (error) Possible null pointer dereference: ctx [glusterfs/xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c:194]: (error) Possible null pointer dereference: ctx [glusterfs/xlators/mgmt/glusterd/src/glusterd-syncop.c:1408]: (error) Possible null pointer dereference: this [glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c:7002]: (error) Possible null pointer dereference: path_tokens Fixed in 3.4 and 3.5 branch (http://review.gluster.org/#/c/7583/ , http://review.gluster.org/#/c/7605/ will be backported in a separate patch) [glusterfs/xlators/mount/fuse/src/fuse-bridge.c:4688]: (error) Uninitialized variable: finh [glusterfs/xlators/mount/fuse/src/fuse-bridge.c:3081]: (error) Possible null pointer dereference: state [glusterfs/xlators/cluster/dht/src/dht-rebalance.c:1719]: (error) Possible null pointer dereference: ctx [glusterfs/xlators/cluster/stripe/src/stripe.c:4940]: (error) Possible null pointer dereference: local [glusterfs/xlators/mgmt/glusterd/src/glusterd-replace-brick.c:915]: (error) Resource leak: file [glusterfs/xlators/mgmt/glusterd/src/glusterd-replace-brick.c:999]: (error) Resource leak: file [glusterfs/xlators/mgmt/glusterd/src/glusterd-sm.c:248]: (error) Possible null pointer dereference: new_ev_ctx [glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c:5297]: (error) Possible null pointer dereference: this [glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c:6273]: (error) Possible null pointer dereference: this [glusterfs/xlators/performance/quick-read/src/quick-read.c:586]: (error) Possible null pointer dereference: iobuf [glusterfs/xlators/nfs/server/src/nfs-common.c:89]: (error) Dangerous usage of 'volname' (strncpy doesn't always null-terminate it). False positives [glusterfs/geo-replication/src/gsyncd.c:99]: (error) Memory leak: str [glusterfs/geo-replication/src/gsyncd.c:395]: (error) Memory leak: argv [glusterfs/xlators/nfs/server/src/nlm4.c:1199]: (error) Possible null pointer dereference: fde [glusterfs/xlators/mgmt/glusterd/src/glusterd-geo-rep.c:1659]: (error) Possible null pointer dereference: command [glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c:7001]: (error) Possible null pointer dereference: path_tokens Insignificant/Don't care [glusterfs/contrib/uuid/gen_uuid.c:369]: (warning) %ld in format string (no. 2) requires 'long *' but the argument type is 'unsigned long *'. [glusterfs/contrib/uuid/gen_uuid.c:369]: (warning) %ld in format string (no. 3) requires 'long *' but the argument type is 'unsigned long *'. [glusterfs/extras/test/test-ffop.c:27]: (error) Buffer overrun possible for long command line arguments. [glusterfs/xlators/cluster/afr/src/afr-self-heal-common.c:138]: (error) Possible null pointer dereference: __ptr [glusterfs/xlators/cluster/afr/src/afr-self-heal-common.c:140]: (error) Possible null pointer dereference: __ptr [glusterfs/xlators/cluster/afr/src/afr-self-heal-common.c:331]: (error) Possible null pointer dereference: __ptr Change-Id: I7696ed1a2a9553b79f9714e10210a8d563a5abd8 BUG: 1091677 Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com> Reviewed-on: http://review.gluster.org/7693 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/locks: Clean up logging of cleanup in DISCONNECT codepathKrutika Dhananjay2014-06-114-69/+126
| | | | | | | | | | | | | | | | | | | Now, gfid is printed as opposed to path in cleanup messages. Also, refkeeper update is eliminated in inodelk and entrylk. Instead, the patch ensures inode and pl_inode are kept alive as long as there is atleast one lock (granted/blocked) on an inode. Also, every inode is unref'd appropriately on a DISCONNECT from the lock-owning client. Change-Id: I531b1a02fe1b889fdd7f54b1fd522e78a18ed1df BUG: 1104915 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/7981 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>
* features/gfid-access: Fix inode leaks and loc path corruptionPranith Kumar K2014-06-102-7/+9
| | | | | | | | | | Change-Id: Ib506db28415d57b344aa90e07e74666ad2063c64 BUG: 1104919 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8009 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kotresh HR <khiremat@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/changelog: skipping empty changelogs in historyAjeet Jha2014-06-102-17/+9
| | | | | | | | | | | | | Empty changelgs are unlinked and htime-update is bypassed while publishing partially written changelog. Change-Id: I1533ad431e4fbf592d2f38837fce782932d01e9c BUG: 1105466 Signed-off-by: Ajeet Jha <ajha@redhat.com> Reviewed-on: http://review.gluster.org/7949 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com>
* feature/changelog: Add timeout to changelog barrier.Kotresh H R2014-06-104-6/+99
| | | | | | | | | | | | | | | | | | | This patch introduces configurable 'changelog-barrier-timeout' in changelog. The default changelog-barrier-timeout is set to 120 sec which is same as barrier-timeout of barrier translator. On this timeout, all the barriered fops are unbarriered. It is safe to have this internal timeout for changelog barrier to prevent it from indefinite barrierring of fops if barrier disable notification does not come from snapshot for some reason. Change-Id: Iad07807935f88222cdefcd46312b4b6579186dce BUG: 1094226 Signed-off-by: Kotresh H R <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/7669 Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com>
* features/gfid-access: Fix memory leaks.Raghavendra G2014-06-101-1/+27
| | | | | | | | | | | Change-Id: I90f6cdb1c8c4face1bb72a9cc77818d308389e45 BUG: 1104919 Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-on: http://review.gluster.org/7982 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* snapview-server: coverity fixesRaghavendra Bhat2014-06-091-7/+10
| | | | | | | | | | Change-Id: If4c866b1155bedabd5cf65dae22fa565b7440938 BUG: 1094815 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/7975 Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/gfid-access: calloc gfid and set in xdataRavishankar N2014-06-081-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: the gfid passed to ga_fill_tmp_loc() was a stack variable which the function set in the xdata dictionary. Accessing it in a later point in time gave unexpected values. This was easy to hit when AFR was involved like so: ga_mknod()--->xxx-->afr_mknod(): In afr_mknod transaction, once the stack-winds for the lock-phase are sent, the gfid in xdata becomes out of scope. When we send the actual op i.e. afr_mknod_wind(), the gfid in xdata is stale, causing posix to set junk gfids on the files. Fix: calloc the gfid and set it in the dict. Thanks to Pranith for the RCA! Change-Id: I0291fce34745268dc63095fc41fe31c7213dd5e1 BUG: 1104707 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/7978 Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/quota: unref and set priv->rpc_clnt to NULL once disabled.Raghavendra G2014-06-052-14/+31
| | | | | | | | | Change-Id: Ic1a6bc36b26cf31f00644bd674b24daa11745e64 BUG: 1103636 Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-on: http://review.gluster.org/7876 Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* glusterd: Changes to provide interface for USSVarun Shastry2014-06-031-1/+3
| | | | | | | | | | | | | | | The changes which consists of the translators for the USS (User Servicable Snapshots) is submitted as a separate patch. Current patch provides the CLI access to the feature. Change-Id: I6b98a42fcfa82f0870d8048fe0bb53141565e9c6 BUG: 1094815 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/7705 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* snapview-server: use telldir api to get the offset of the dentryRaghavendra Bhat2014-06-021-3/+3
| | | | | | | | | | | | | | | | | * dirent structure (struct dirent) in NetBSD does not contain the offset member. Direct access of offset from struct dirent (used here to copy its contents to gf_dirent_t structure after making readdir call) causes glusterfs build failures on NetBSD. So like posix does, use telldir api to get the offset of the dentry (in this case glfs_telldir). Change-Id: I72472c16cbf55dd99ea80ba982b0a4205e6ebffb BUG: 1103591 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/7946 Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* cluster/dht: Fix min-free-disk calculations when quota-deem-statfs is onKrutika Dhananjay2014-06-021-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PROBLEM: As part of file creation, DHT sends a statfs call to all of its sub-volumes and expects in return the local space consumption and availability on each one of them. This information is used by DHT to ensure that atleast min-free-disk amount of space is left on each sub-volume in the event that there ARE other sub-volumes with more space available. But when quota-deem-statfs is enabled, quota xlator on every brick unwinds the statfs call with volume-wide consumption of disk space. This leads to miscalculation in min-free-disk algo, thereby misleading DHT at some point, into thinking all sub-volumes have equal available space, in which case DHT keeps sending new file creates to subvol-0, causing it to become 100% full at some point although there ARE other subvols with ample space available. FIX: The fix is to make quota_statfs() behave as if quota xlator weren't enabled, thereby making every brick return only its local consumption and disk space availability. Change-Id: I211371a1eddb220037bd36a128973938ea8124c2 BUG: 1099890 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/7845 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>