summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* features/bitrot: stub improvements and fixesVenky Shankar2015-05-285-426/+435
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch refactors the signing trigger mechanism used by bitrot daemon as a "catch up" meachanism to sign files which _missed_ signing on the last run either due to bitrot being disabled and enabled again or if bitrot is enabled for a volume with existing data. Existing implementation relies on overloading writev() to trigger signing which just by the looks sounded dangerous and I hated it to the core. This change moves all that business to the setxattr interface thereby keeping the writev path strictly for client IO. Why not use IPC fop to trigger signing? There's a need to access the object's inode to perform various maintainance operations. inode is not _directly_ accessible in the IPC fop (although, it can be found via inode_grep() for the object's GFID - the inode just needs to be pinned in memory, which is the case if there's an active fd on the inode). This patch relies on good old technique of overloading fsetxattr() to do the job instead of using IPC fop. There are some pretty nice cleanups along the lines of memory deallocations, unncessary allocations and redundant ref()ing of structures (such as fd's) provided by this patch. All in all - much improved code navigation. Change-Id: Id93fe90b1618802d1a95a5072517dac342b96cb8 BUG: 1224600 Signed-off-by: Venky Shankar <vshankar@redhat.com> Reviewed-on: http://review.gluster.org/10942 Tested-by: NetBSD Build System Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* libgfapi: introduce bit flags for pthread mutex and cond variablesHumble Devassy Chirammal2015-05-282-73/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | At present stage, the initialization and destroy of conditional and mutex variables of glfs struct happen in different places and there is no uniform way of destroying these variables incase there is a failure when initializing these. The fs mutex and conditional variables are getting destroyed from glfs_free_from_ctx(). However this destroy is not done by a conditional check inside destroy function. By introducing bit flags in glfs object, we can make use of the same (if there is a failure in initialization) in glfs_fini() which is evolving as one and only function to free fs and ctx resources. This patch introduce the flags field and set the flags according to the initialization flow of the mutex and conditional variables of struct glfs members. Without this patch we are compelled to use the goto lables and other hacks in init functions to make sure the resources are freed if there is an error path. Change-Id: I86e2719fb7ce437419a05699b4f06c14b02d0e69 BUG: 1208482 Signed-off-by: Humble Devassy Chirammal <hchiramm@redhat.com> Signed-off-by: Poornima G <pgurusid@redhat.com> Reviewed-on: http://review.gluster.org/10120 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
* spec: correct the vendor string in spec fileHumble Devassy Chirammal2015-05-281-1/+1
| | | | | | | | | | Change-Id: Id19c973092af506582741887d12fe00c85022f15 BUG: 1198849 Signed-off-by: Humble Devassy Chirammal <hchiramm@redhat.com> Reviewed-on: http://review.gluster.org/10885 Tested-by: NetBSD Build System Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* build: do not include rpcgen generated files in "make dist"Niels de Vos2015-05-281-3/+6
| | | | | | | | | | | | | The .c and .h files are generated by rpcgen, there is no need to include them in the "make dist" tarball. BUG: 1198849 Change-Id: Ie6281720e4d485d2b84d98efccfc7053594d1542 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/10897 Tested-by: NetBSD Build System Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* glusterfs.spec.in: move libgf{db,changelog}.pc from -api-devel to -develKaleb S. KEITHLEY2015-05-281-2/+5
| | | | | | | | | | | | | pkgconfig files in the wrong package results in unexpected package dependencies Change-Id: I0551114d09bcc3a7a73e152275175ba6c1bc0da3 BUG: 1223385 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/10843 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* cluster/dht: Don't rely on linkto xattr to find destination subvol during ↵Raghavendra G2015-05-281-101/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | phase 2 of migration. linkto xattr on source file cannot be relied to find where the data file currently resides. This can happen if there are multiple migrations before phase 2 detection by a client. For eg., * migration (M1, node1, node2) starts. * application writes some data. DHT correctly stores the state in inode context that phase-1 of migration is in progress * migration M1 completes * migration (M2, node2, node3) is triggered and completed * application resumes writes to the file. DHT identifies it as phase-2 of migration. However, linkto xattr on node1 points to node2, but the file is on node3. A lookup correctly identifies node3 as cached subvol TBD: When we identify phase-2 of a previous migration (say M1), there might be a migration in progress - say (M3, node3, node4). In this case we need to send writes to both (node3, node4) not just node3. Also, the inode state needs to correctly indicate that its in phase-1 of migration. I'll send this as a different patch. Change-Id: I1a861f766258170af2f6c0935468edb6be687b95 BUG: 1142423 Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-on: http://review.gluster.org/10805 Tested-by: NetBSD Build System
* afr: allow readdir to proceed for directories in split-brainRavishankar N2015-05-282-18/+59
| | | | | | | | | | | | | | | | | | | Problem: afr_read_txn() bails out if read_subvol==-1. This meant that for directories that were in entry split-brain, FOPS like readdir, access, stat etc were not allowed. Fix: Except for getxattr, all other FOPS are wound on the first up child of afr. Change-Id: Iacec8fbb1e75c4d2094baa304f62331c81a6f670 BUG: 1221481 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/10776 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Anuradha Talur <atalur@redhat.com> Tested-by: NetBSD Build System
* fuse: squash 64-bit inodes in readdirp when enable-ino32 is setNiels de Vos2015-05-283-4/+9
| | | | | | | | | | | | | | | The structures returned by readdirp contain the inode 2x. Only one of them was squashed into 32-bits when enable-ino32 is enabled. Change-Id: I33a6d28fb118bb23971f918ffeb983d7f033106e BUG: 1223889 Signed-off-by: Niels de Vos <ndevos@redhat.com> Tested-by: Cyril Peponnet <cyril@peponnet.fr> [on release-3.5] Reviewed-on: http://review.gluster.org/10881 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* gfapi: zero size issue in glfs_h_acl_set()Jiffin Tony Thottan2015-05-282-2/+6
| | | | | | | | | | | | | | | | | | | When setting the stringified ACLs in the xattr dict through pub_glfs_h_setxattrs(), the size of the string is always passed as 0. The correct way is to pass the length of the ACL in text form. While verifying this issues, it seems that posix_pacl_set() should return the errno instead of -1. This helps in debugging, otherwise EPERM would always be returned on an error. [ndevos: fix off-by-one strlen() and return errno in posix_pacl_set()] Change-Id: Ia7a7fa1f3a7d615a813c703057dc97b09a0bbb34 BUG: 789278 Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com> Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/10782 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com>
* glusterd: fix repeated connection to nfssvc failed msgsKrishnan Parthasarathi2015-05-283-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | ... and disable reconnect timer on rpc_clnt_disconnect. Root Cause ---------- gluster-NFS service wouldn't be started if there are no started volumes that have nfs service enabled for them. Before this fix we would initiate a connect even when the gluster-NFS service wasn't (re)started. Compounding that glusterd_conn_disconnect doesn't disable reconnect timer. So, it is possible that the reconnect timer was in execution when the timer event was attempted to be removed. Change-Id: Iadcb5cff9eafefa95eaf3a1a9413eeb682d3aaac BUG: 1222378 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/10830 Tested-by: NetBSD Build System Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Gaurav Kumar Garg <ggarg@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com> Tested-by: Kaushal M <kaushal@redhat.com>
* glusterd : allocate peerid to store in frame->cookieAtin Mukherjee2015-05-283-42/+94
| | | | | | | | | | | | | | | | | | | commit a1de3b05 was using peerid from the stack and storing it in the frame->cookie and in the subsequent callback it was referred. The existance of this variable is not guranteed in the cbk since its not dynamically allocated. Fix is to dynmacially manage peerid in the frame cookie. This patch also fixes one problem in gd_sync_task_begin () where unlock is not triggered if the cluster is running with lesser than 3.6 op-version resulting into commands failing with another transaction is in progress. Change-Id: I0d22cf663df53ef3769585703944577461061312 BUG: 1223213 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/10842 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
* features/shard: Skip block count and size update for directoriesKrutika Dhananjay2015-05-271-0/+2
| | | | | | | | | | Change-Id: Iaa7022c95a8d9c9c471db025ec644e0bcc4eeb29 BUG: 1221104 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/10772 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* protocol/client,server: Move EEXIST logs in mkdir and mknod to DEBUG levelKrutika Dhananjay2015-05-273-4/+10
| | | | | | | | | | Change-Id: I0481258de8da36cbee7c046f53b20359badaf064 BUG: 1221889 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/10791 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* cluster/afr: Treat op_ret >= 0 as success in afr_final_errno()Krutika Dhananjay2015-05-271-1/+1
| | | | | | | | | | Change-Id: I7ec29428b7f7ef249014f948a5d616bfb8aaf80d BUG: 1225491 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/10946 Tested-by: NetBSD Build System Reviewed-by: Ravishankar N <ravishankar@redhat.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* tests: Remove tests from bad testsRavishankar N2015-05-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | All known ec eio issues we know are solved with http://review.gluster.com/10852 So removing these ec tests from bad tests: ./tests/basic/ec/ec-5-1.t ./tests/basic/ec/ec.t Removing the following tests because they are one-off failures and the logs do not show anything significant. ./tests/bugs/replicate/bug-1015990.t ./tests/bugs/glusterfs/bug-867253.t ./tests/basic/afr/sparse-file-self-heal.t Removing the following tests as they are fixed by 10918: ./tests/basic/ec/quota.t ./tests/basic/quota-nfs.t ./tests/bugs/quota/bug-1035576.t BUG: 1165041 Change-Id: Ie3701d376ef383375f3e9853df26baa617628cdd Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/10930 Tested-by: NetBSD Build System Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* quota: fix for spurious failurevmallika2015-05-271-20/+31
| | | | | | | | | | | | | | | | | | | | | | During ancestry build, loc path was set to invalid path. path was set to one of its child instead of itself. Because of this quota accounting was going wrong This patch fix the issue Below mentioned tests removed from bad test list as part of patch# 10930 ./tests/basic/ec/quota.t ./tests/basic/quota-nfs.t ./tests/bugs/quota/bug-1035576.t Change-Id: Iaa65b2d968c04c9abcd476d0e9f588cb7fd39294 BUG: 1223798 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/10918 Tested-by: NetBSD Build System Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* tests: Fix typo in ssl-authz.tDeepak C Shetty2015-05-271-1/+1
| | | | | | | | | | | | Fixes a typo that was incorrectly causing the ssl cipher list not to be set properly on the test volume. Change-Id: I7969988551aa0c76261e41ab2f6247b684dacd49 Signed-off-by: Deepak C Shetty <deepakcs@redhat.com> Reviewed-on: http://review.gluster.org/10914 Tested-by: NetBSD Build System Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* tests/uss.t: wait for connection to complete before accessing a file in snapshotRaghavendra Bhat2015-05-272-3/+2
| | | | | | | | | | Change-Id: I82d0cb378d006777d5a304afe8d5be15e92c7245 BUG: 1163543 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/10915 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* meta: implement fsync(dir)Raghavendra G2015-05-273-17/+40
| | | | | | | | | | Change-Id: I707c608a9803fe6ef86860ca5578d4d3f63fd2aa BUG: 1225323 Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-on: http://review.gluster.org/10929 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* tier/tier.t: Fixing tier.t crash in regression runsJoseph Fernandes2015-05-273-9/+17
| | | | | | | | | | | | | | | | 1) If the database file exists a. Dont try re-creating the db schema b. Dont try re-configuring the db. 2) Dont assert in fini_db () when connection is NULL Change-Id: I15dd103fe7542f70113c1d5e539a99f8cd062be4 BUG: 1163543 Signed-off-by: Joseph Fernandes <josferna@redhat.com> Reviewed-on: http://review.gluster.org/10870 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* cluster/ec: Forced unlock when lock contention is detectedXavier Hernandez2015-05-2713-999/+1139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EC uses an eager lock mechanism to optimize multiple read/write requests on the same entry or inode. This increases performance but can have adverse results when other clients try to access the same entry/inode. To solve this, this patch adds a functionality to detect when this happens and force an earlier release to not block other clients. The method consists on requesting GF_GLUSTERFS_INODELK_COUNT and GF_GLUSTERFS_ENTRYLK_COUNT for all fops that take a lock. When this count is greater than one, the lock is marked to be released. All fops already waiting for this lock will be executed normally before releasing the lock, but new requests that also require it will be blocked and restarted after the lock has been released and reacquired again. Another problem was that some operations did correctly lock the parent of an entry when needed, but got the size and version xattrs from the entry instead of the parent. This patch solves this problem by binding all queries of size and version to each lock and replacing all entrylk calls by inodelk ones to remove concurrent updates on directory metadata. This also allows rename to correctly update source and destination directories. Change-Id: I2df0b22bc6f407d49f3cbf0733b0720015bacfbd BUG: 1165041 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/10852 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* posix: Do not update unmodified xattr in (f)xattropXavier Hernandez2015-05-272-10/+27
| | | | | | | | | | | | | | | If a (f)xattrop is issued with a value that only contains 0's, then we don't modify or create the extended attribute. This is useful to avoid ctime modifications when the only purpose of the xattrop was to get the current value. Change-Id: Ia62494e9009962e683c8276783f671da17a8b03a BUG: 1211123 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/10886 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* features/locks: Handle virtual getxattrs in more fopsPranith Kumar K2015-05-272-279/+339
| | | | | | | | | | | | With this patch getxattr of inodelk/entrylk counts can be requested in readv/writev/create/unlink/opendir. Change-Id: If7430317ad478a3c753eb33bdf89046cb001a904 BUG: 1165041 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/10880 Tested-by: NetBSD Build System Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
* glusterd: Fix conf->generation to stop new peers participating inAvra Sengupta2015-05-272-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a transaction, while the transaction is in progress. Every peer gets a generation number, during it's inception. This generation number is used to identify the peer throiughout it's lifetime. This number is assigned based on the current generation number of the system, which is incremented with every peer that is added. The problem arises when we add a peer, and before it gets a rpc_connect we begin a transaction. In such a case, the peer gets considered in the transaction, but doesn't participate in it coz it isn't connected yet. The moment it gets the rpc notification and is connected, it starts participating in the transaction and all hell breaks loose. To resolve it, we should assign the peerinfo a new generation number everytime it's connected, so that this number will be greater than the generation number that the transaction is acting upon, and even though the peer is connected it will not participate in the transaction. We should also assign the new generation number of the peer to the peerctx, so that the framework that searches for peerinfos based on the generation number, will still function in the same manner. Removing ./tests/basic/volume-snapshot-clone.t from bad-tests. Also removed the duplicate entry of ./tests/bugs/snapshot/bug-1112559.t from bad-tests. Original entry was removed in http://review.gluster.org/10840 Change-Id: Ie25e3ecf59b19535b9cded7449e944221fac97a0 BUG: 1224290 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/10895 Reviewed-by: Kaushal M <kaushal@redhat.com> Tested-by: Kaushal M <kaushal@redhat.com>
* tests: Fix entry-self-heal.tKrutika Dhananjay2015-05-263-4/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | Because both bricks in the replica pair of patchy are in the same node, both full healer threads within the same shd try and fail to acquire non-blocking locks when each one gets lock on one of the bricks, causing heal to fail occasionally. Now heals are triggered from the mount as part of inode refresh. And because the AFR on the mount graph a. does not treat presence of dirty xattrs as something that needs a heal (this is true for dirs fool_heal and fool_me) and b. does not recursively heal the entire hierarchy of subdirs and their entries in one shot (this is true with source_creations_heal/dir1), index heal is used to heal fool_heal, fool_me and source_creations_heal/dir1 wherein only one brick (which is the brick that contains the good copy of source_creations_heal/dir_1: brick-1) has all the gfids to be healed copied into its indices/xattrop directory. Change-Id: I46df4188f16d1623f20cc0d7266b3afaeca6c31f BUG: 1163543 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/10916 Tested-by: NetBSD Build System Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* glusterd: fix double-free of rebalance process' rpc objectKrishnan Parthasarathi2015-05-266-9/+72
| | | | | | | | | | | Change-Id: I0c79c4de47a160b1ecf3a8994eedc02e3f5002a9 BUG: 1223338 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/10872 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
* tests: remove read-subvol-entry.t from is_bad_testRavishankar N2015-05-261-1/+0
| | | | | | | | | | Change-Id: I81750655d5686709908563e68f40821140397050 BUG: 1163543 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/10917 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* tests: add ec/ec.t to is_bad_testKrishnan Parthasarathi2015-05-261-0/+1
| | | | | | | | | | | | ... to avoid ec.t's spurious regression test failure coming in the way of fixes for other independent spurious regression test failures. Change-Id: Id393be571685ca1e69732c1149c370b6fd0e6d17 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/10907 Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com>
* Quota: fix testcases not to send parallel writes for accuratevmallika2015-05-2513-65/+157
| | | | | | | | | | | | | | | | | | | | | | | quota enforcement Currently quota enforcer doesn't consider parallel writes and allows quota to exceed limit where there are high rate of parallel writes. Bug# 1223658 tracks the issue. This patch fixes the spurious failures by not sending parallel writes. Using O_SYNC and O_APPEND flags and block size not more that 256k (For higher block size NFS client splits the block into 256k chinks and does parallel writes) Change-Id: I297c164b030cecb87ce5b494c02b09e8b073b276 BUG: 1223798 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/10878 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* tests: arbiter.t fixRavishankar N2015-05-243-4/+9
| | | | | | | | | | | | | | | | | | | Wait for AFR's children to be up in glustershd process before attempting heal. Also, grep (version 2.21) is detecting statedump files as binary, causing tests to succeed incorrectly. Hence adding the -a switch to force it to treat it as a text file. Thanks to Vijay Bellur for identifying the issue (http://lists.gnu.org/archive/html/bug-grep/2015-05/msg00000.html) and the workaround. Change-Id: Ie3d9591ffaf44baa0cd8c2baa327aed24378e3df BUG: 1163543 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/10833 Tested-by: NetBSD Build System Tested-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* tests: data-self-heal.t fixRavishankar N2015-05-222-3/+26
| | | | | | | | | | | | | Use Index heal instead of full heal to heal files because if both bricks are on the same node, the 2 full heal threads might compete and fail to acquire the non blocking locks and the file might not get healed during the full heal crawl. Change-Id: I3b9e2de7b0366b4bc40b54314807ef165baad68f BUG: 1163543 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/10875 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* tests: add more tests to bad_test for the interimKrishnan Parthasarathi2015-05-211-0/+3
| | | | | | | | Change-Id: Icd92f1b999c8cda310053306c63a7445146a55db Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/10888 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com>
* cluster/ec: Fix use after free crashPranith Kumar K2015-05-214-23/+47
| | | | | | | | | | | | | | | | | ec_heal creates ec_fop_data but doesn't run ec_manager. ec_fop_data_allocate adds this fop to ec->pending_fops, because ec_manager is not run on this heal fop it is never removed from ec->pending_fops. When it is accessed after free it leads to crash. It is better to not to add HEAL fops to ec->pending_fops because we don't want graph switch to hang the mount because of a BIG file/directory heal. BUG: 1188145 Change-Id: I8abdc92f06e0563192300ca4abca3909efcca9c3 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/10868 Reviewed-by: Xavier Hernandez <xhernandez@datalab.es> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
* tests: Removing tests/bugs/snapshot/bug-1112559.t from test-suiteAvra Sengupta2015-05-202-62/+0
| | | | | | | | | | | | | The fix that introduced this test has been reverted as part of design change. Hence removing it from the test-suite Change-Id: I7acaf387ec3035f736498a437c736fe70970d421 BUG: 1219738 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/10840 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* glusterd: populate errstr if gd_syncop_submit_request failsAtin Mukherjee2015-05-201-0/+3
| | | | | | | | | | | Change-Id: Ie4a3edef5d553fc07de53b46f9485c46a4305245 BUG: 1219732 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/10659 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* cluster/ec: Correctly cleanup delayed locksXavier Hernandez2015-05-209-72/+213
| | | | | | | | | | | | | | | | | When a delayed lock is pending, a graph switch doesn't correctly terminate it. This means that the update of version and size xattrs is lost, causing EIO errors. This patch handles GF_EVENT_PARENT_DOWN event to correctly finish pending udpdates before completing the graph switch. Change-Id: I394f3b8d41df8d83cdd36636aeb62330f30a66d5 BUG: 1188145 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/10787 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* test: Fix sparse file self heal testzhoushicheng2015-05-192-1/+10
| | | | | | | | | | | | | | | | | | | | | | | This patch solves problems caused by XFS with speculative preallocation feature on : Test EXPECT "1" has_holes $B0/${V0}0/big2bigger would fall when XFS has not freed the preallocated blocks. It is caused by XFS speculative preallocation feature. The test would pass if this feature is disabled. Speculative preallocation can speed up under linux 3.8(and later). Otherwise, the test would pass by dropping cache manually to speed up speculative preallocation. As in http://review.gluster.org/#/c/10411/, using "( cd $M0 ; umount $M0 )" to drop caches, which is better than "echo 3 > /proc/sys/vm/drop_caches". drop caches operation was added in test: tests/basic/afr/sparse-file-self-heal.t BUG: 1206461 Change-Id: Ie2c9d1b92fa8307c44498752fdd100eb86f9689c Signed-off-by: zhoushicheng <madaozhou@gmail.com> Reviewed-on: http://review.gluster.org/10253 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Ravishankar N <ravishankar@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* cluster/ec: Handle lookup failures while op in progressPranith Kumar K2015-05-192-12/+23
| | | | | | | | | | Change-Id: Ia1834ec23d5de615526d4d4e4d2e32aff155b7f7 BUG: 1211962 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/10806 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
* tests: Remove bug-976800.t from is_bad_test()Vijay Bellur2015-05-191-1/+0
| | | | | | | | | | | | commit d4d9cfc82d7cf77972 has already fixed this test. Change-Id: I7ecef580af6c7a3b3b786ab583705123475afcb6 BUG: 1220058 Signed-off-by: Vijay Bellur <vbellur@redhat.com> Reviewed-on: http://review.gluster.org/10813 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* move trash doc to features sub directoryHumble Devassy Chirammal2015-05-191-0/+0
| | | | | | | | | | Change-Id: I3ca9a0c8fddc7af516aaf5a6d4a880fb24e3c058 BUG: 1206539 Signed-off-by: Humble Devassy Chirammal <hchiramm@redhat.com> Reviewed-on: http://review.gluster.org/10810 Tested-by: NetBSD Build System Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Anoop C S <achiraya@redhat.com>
* tests: data-self-heal.t-create files from the mount point.Ravishankar N2015-05-181-32/+14
| | | | | | | | | | | | | | | | | | Currently data-self-heal.t creates files directly on the brick and sets the trusted.gfid xattr. Later it depends on stat from mount to create the .glusterfs/<gfid hard link>. The link creation doesn't seem to be happening always. Hence changing the test to create files from the mount point before modifying afr xattrs in the backend and triggering heal. Also disabled all performance translators. With these changes, http://review.gluster.org/#/c/10667/ is not failing in data-self-heal.t Change-Id: I7d054e52b97aeb0bdc2fdf9d70a8cf33318d4310 BUG: 1218304 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/10530 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* Tests: avoid hang in br-stub.tEmmanuel Dreyfus2015-05-181-0/+2
| | | | | | | | | | | | | | | | | br-stub.t forgot to unmount the NFS mount, leading to the situation where cleanup code had to do it after glusterfs daemon were shut down. NetBSD has trouble dealing with this situation and may enter endless wait for the NFS server to come back. Fix is simply to unmount before the end og the script BUG: 1129939 Change-Id: I972d379172a75f29ad11abc66d700c2d31106194 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/10748 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* tests: write log for glupy.t to the standard log directoryNiels de Vos2015-05-163-3/+4
| | | | | | | | | | | | | | | | | | There is (or was) a spurious test in glupy.t for which a separate log file was setup. The directory where the log is saved, is not available on NetBSD and this causes glupy.t to always fail, without a log. Instead of hard-coding the path to the log, use "gluster --print-logdir" to provide a LOGDIR environment variable. glupy.t now writes the log to an existing directory. BUG: 1163543 Change-Id: Ifa73198d06fa267856d0da9d25a4380329909124 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/10801 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* nfs: Use uuid_clear() instead of memsetVijay Bellur2015-05-161-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the following incorrect usage: mount3.c: In function '__mnt3_build_mountid_from_path': mount3.c:705:24: warning: 'sizeof' on array function parameter 'mountid' will return size of 'unsigned char *' [-Wsizeof-array-argument] length = sizeof(mountid); ^ mount3.c:699:58: note: declared here __mnt3_build_mountid_from_path (const char *path, uuid_t mountid) ^ mount3.c: In function '__mnt3_get_mount_id': mount3.c:732:24: warning: 'sizeof' on array function parameter 'mountid' will return size of 'unsigned char *' [-Wsizeof-array-argument] length = sizeof(mountid); ^ mount3.c:726:46: note: declared here __mnt3_get_mount_id (xlator_t *mntxl, uuid_t mountid) Change-Id: I08f46c5994578fc99a7b61681e808d1115e41d71 BUG: 1221095 Signed-off-by: Vijay Bellur <vbellur@redhat.com> Reviewed-on: http://review.gluster.org/10765 Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* cluster/tier: load libgfdb.so properly in all casesDan Lambright2015-05-161-1/+1
| | | | | | | | | | | | | We should load libgfdb.so.0, not libgfdb.so Change-Id: I7a0d64018ccd9893b1685de391e99b5392bd1879 BUG: 1222092 Signed-off-by: Dan Lambright <dlambrig@redhat.com> Reviewed-on: http://review.gluster.org/10796 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Joseph Fernandes Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* fuse: fix return value check for setuidPrasanna Kumar Kalever2015-05-161-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | setuid() sets the effective user ID of the calling process. If the effective UID of the caller is root, the real UID and saved set-user-ID are also set. On success, zero is returned. On error, -1 is returned, and errno is set appropriately. there are cases where setuid() can fail even when the caller is UID 0; it is a grave security error to omit checking for a failure return from setuid(). if an environment limits the number of processes a user can have, setuid() might fail if the target uid already is at the limit. Fix is to check return value of setuid. Change-Id: I7aa5ab5e347603c69dc93188417cc4f4c81ffc75 BUG: 1221490 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> Reviewed-on: http://review.gluster.org/10780 Reviewed-by: Prasanna Kumar Kalever Tested-by: Prasanna Kumar Kalever Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Gaurav Kumar Garg <ggarg@redhat.com>
* cluster/ec: Prevent unnecessary self-healsPranith Kumar K2015-05-151-2/+11
| | | | | | | | | | | | | | | | When a blocking lock is requested, lock request is succeeded even when ec->fragment number of locks are acquired successfully in non-blocking locking phase. This will lead to fop succeeding only on the bricks where the locks are acquired, leading to the necessity of self-heals. To prevent these un-necessary self-heals, if the remaining locks fail with EAGAIN in non-blocking lock phase try blocking locking phase instead. Change-Id: I940969e39acc620ccde2a876546cea77f7e130b6 BUG: 1221145 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/10770 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
* dht/rebalance : Fixed rebalance failureNithya Balachandran2015-05-142-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | The rebalance process determines the local subvols for the node it is running on and only acts on files in those subvols. If a dist-rep or dist-disperse volume is created on 2 nodes by dividing the bricks equally across the nodes, one process might determine it has no local_subvols. When trying to update the commit hash, the function attempts to lock all local subvols. On the node with no local_subvols the dht inode lock operation fails, in turn causing the rebalance to fail. In a dist-rep volume with 2 nodes, if brick 0 of each replica set is on node1 and brick 1 is on node2, node2 will find that it has no local subvols. Change-Id: I7d73b5b4bf1c822eae6df2e6f79bd6a1606f4d1c BUG: 1221696 Signed-off-by: Nithya Balachandran <nbalacha@redhat.com> Reviewed-on: http://review.gluster.org/10786 Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Reviewed-by: Susant Palai <spalai@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* dht : null dereference coverity fix.Manikandan Selvaganesh2015-05-141-1/+2
| | | | | | | | | | | | | CID : 1124521 Change-Id: Ie524935d636195cb6894074095b9b98fe28dbc2c BUG: 789278 Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com> Reviewed-on: http://review.gluster.org/10348 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Sakshi Bansal Reviewed-by: N Balachandran <nbalacha@redhat.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
* quota/glusterd: on read call number of byte read should equal to buffer lengthGaurav Kumar Garg2015-05-141-2/+1
| | | | | | | | | | | | | | | | | glusterd is crashing when user try to set limit-usage on quota. Because in the read call number of byte is going to be read is more then buffer lenght. Change-Id: Ie507eb68ebc0d0daa1012baef1bf724e202e3baa BUG: 1221025 Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/10766 Reviewed-by: Anand Nekkunti <anekkunt@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>