summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* MAINTAINERS: Adding new sub maintainers.Humble Devassy Chirammal2014-12-181-25/+54
| | | | | | | | | | | | | http://supercolony.gluster.org/pipermail/gluster-devel/2014-December/043177.html Change-Id: Iec587f383cf8da9832932194e2518a6bd99c6380 Signed-off-by: Humble Devassy Chirammal <hchiramm@redhat.com> Reviewed-on: http://review.gluster.org/9266 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* performance/readdir-ahead: indicate EOF for readdirpRaghavendra Bhat2014-12-171-2/+9
| | | | | | | | | | | | | | | | | | posix xlator sends op_errno as ENOENT and op_ret as 0, to indicate readdir has been completed. readdir-ahead should send that op_errno that it has saved in the fd context, when it serves the readdir requests. Otherwise some xlators sitting above performance xlators such as snapview-client, which checks for end of readdir operation by checking op_ret to 0 and op_errno to ENOENT will not be able to identify end of readdir. Change-Id: Ib0835136c61cb1e0d7df933226c479c7db703a71 BUG: 1174783 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/9283 Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* ec: Fix more mutex related coverity scan issuesXavier Hernandez2014-12-171-9/+5
| | | | | | | | | | | This patch solves CID 1257622. Change-Id: I95680c7de49cd84011d2ad38f02e5fad82e15c90 BUG: 1170254 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/9263 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com>
* Regression test portability: ec.tEmmanuel Dreyfus2014-12-171-4/+4
| | | | | | | | | | | | | This test unmount/remount the filesystem to invalidate cache, but this leads to timing problems on NetBSD. We can work them around without sleeping by remounting on another mount point. BUG: 1129939 Change-Id: I10b3183e5e715053de162a6980af188710b607bb Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9285 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
* telldir()/seekdir() portability fixesEmmanuel Dreyfus2014-12-179-31/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | POSIX says that an offset obtained from telldir() can only be used on the same DIR *. Linux is abls to reuse the offset accross closedir()/opendir() for a given directory, but this is not portable and such a behavior should be fixed. An incomplete fix for the posix xlator was merged in http://review.gluster.com/8926 This change set completes it. - Perform the same fix index xlator. - Use appropriate casts and variable types so that 32 bit signed offsets obtained by telldir() do not get clobbered when copied into 64 bit signed types. - modify glfs-heal.c and afr-self-heald.c so that they do not use anonymous fd, since this will cause closedir()/opendir() between each syncop_readdir(). On failure we fallback to anonymous fs only for Linux so that we can cope with updated client vs not updated brick. - Avoid sending an EINVAL when the client request for the EOF offset. Here we fix an error in previous fix for posix xlator: since we fill each directory entry with the offset of the next entry, we must consider as EOF the offset of the last entry, and not the value of telldir() after we read it. - Add checks in regression tests that we do not hit cases where offsets fed to seekdir() are wrong. Introduce log_newer() shell function to check for messages produced by the current script. This fix gather changes from http://review.gluster.org/9047 and http://review.gluster.org/8936 making them obsolete. BUG: 1129939 Change-Id: I59fb7f06a872c4f98987105792d648141c258c6a Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9071 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Tested-by: Raghavendra Bhat <raghavendra@redhat.com>
* uss/gluster: In SVS, check for entry-point in dict only if inode_ctx isvmallika2014-12-161-17/+19
| | | | | | | | | | | | | | not available Change-Id: I990487003b712bf4aed8f54291417965f301655e BUG: 1172430 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/9265 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Sachin Pandit <spandit@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* gfapi: use different name for GETSPEC callback than the one used by glusterfsdRaghavendra Bhat2014-12-151-3/+3
| | | | | | | | | | | Change-Id: Ibd5be1e1080f9da4ac1fb9112538b3320ef2ff28 BUG: 1174205 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/9277 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
* build: prevent double packaging of geo-replication and other scriptsNiels de Vos2014-12-151-1/+6
| | | | | | | | | | | | | The regression-tests sub-package contains /usr/share/glusterfs/* instead of including only the needed files. This causes some of the scripts that are part of geo-replication to be packaged twice. BUG: 1169005 Change-Id: Ib452e73f3c1775b252ab257aab852ad9af857e74 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9272 Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* Update admin_distributed_geo_rep.mdMorten Johansen2014-12-141-1/+1
| | | | | | | | | | | Fixed typo Change-Id: If4281237394ed96b32ec2d6227827214908052cf Signed-off-by: Justin Clift <justin@gluster.org> Reviewed-on: http://review.gluster.org/9268 Reviewed-by: M S Vishwanath Bhat <vbhat@redhat.com> Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* features/snapview-client: handle fsync fopRaghavendra Bhat2014-12-121-0/+45
| | | | | | | | | | Change-Id: Idaf46bd7497266af837789b09a0c62698f56ee4e BUG: 1172262 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/9258 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Sachin Pandit <spandit@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* fuse: protect checking/modifying graph->used with a mutexNiels de Vos2014-12-121-3/+9
| | | | | | | | | | | | | | | | | | While reviewing http://review.gluster.org/#/c/9060/ we noticed that fuse checks/modifies graph->used in a unlocked way. There is a potential race in case when fuse_graph_setup() gets called from two different threads (currently unlikely, but poller/notify() might change in future?). In libgfapi we came to the conclusion that each glfs structure can be used to protect the checking/updating of graph->used. In fuse this would be the fuse_private_t with sync_mutex. BUG: 1170643 Change-Id: If5ab5468d22fdb92cfb24a469f538f63f12baf78 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9237 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* build: FreeBSD 11-Current causes libtool to fail with '-shared'Harshavardhana2014-12-124-5/+5
| | | | | | | | | | | | Thanks for Markiyan Kushnir <markiyan.kushnir@gmail.com> for reporting this Change-Id: I7f637295c7c2d54c33a4c16e29daf0b518874911 BUG: 1111774 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/9251 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* client_t: fix for potential NULL pointer dereferenceNiels de Vos2014-12-121-3/+4
| | | | | | | | | | | | | In case an error occurs, 'client' is free'd. The log message just before exiting the function should therefore not use the structure anymore. BUG: 789278 Change-Id: I0848328b29585057cd037a5972c4e5f06a7f978b CID: 1226165 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9262 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* Stop logrotate from complaining about missing files.Jan-Hendrik Zab2014-12-111-1/+1
| | | | | | | | | | | | | | Previously logrotate reported errors for files missing in "/var/log/glusterfs/geo-replication-slaves/*/*.log". Fixed by reordering directives in the example config. Change-Id: I7cdb9e0d82f08aa27d5e26664660204fdeb8e98e BUG: 1170825 Signed-off-by: Jan-Hendrik Zab <zab@l3s.de> Reviewed-on: http://review.gluster.org/9264 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com>
* rpc/rpcsvc: add peername to log messagesKrishnan Parthasarathi2014-12-102-13/+22
| | | | | | | | | | | | | This would allow users/developers to associate rpc layer log messages to the corresponding connection. Change-Id: I040f79248dced7174a4364d9f995612ed3540dd4 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/8535 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* storage/posix: Set errno for xattrop failuresPranith Kumar K2014-12-101-0/+3
| | | | | | | | | | Change-Id: I4d44068c8da5257227d62906ec18ae16f6ed6c02 BUG: 1172477 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/9261 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Tested-by: Raghavendra Bhat <raghavendra@redhat.com>
* nfs: prevent potential NULL dereference in mnt3_readlink_cbk()Niels de Vos2014-12-101-2/+6
| | | | | | | | | | | | | | In case 'mres' is NULL, we jump to 'mnterr' where 'mres->req' will be used. This will cause a segmentation fault, which we really do not want. Change-Id: I01d6f3aa0343def54dcd4a5610001ff7d62c8834 CID: 1256179 BUG: 789278 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9257 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: jiffin tony Thottan <jthottan@redhat.com> Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
* features/snapview-client: handle readdir requests differently for sambaRaghavendra Bhat2014-12-097-9/+722
| | | | | | | | | | | * For samba export, the entry point is also added to the readdir response. Change-Id: I825c017e0f16db1f1890bb56e086f36e6558a1c2 BUG: 1168875 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/9218 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* cluster/afr: Associate the inode returned by inode_link() with corresponding ↵Krutika Dhananjay2014-12-091-1/+4
| | | | | | | | | | | | | entry Change-Id: Ic4436a64075a2615a2293cdfdf2ba6622827cafa BUG: 1129939 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/9254 Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org> Tested-by: Emmanuel Dreyfus <manu@netbsd.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* api, glusterfsd: Cleanup upon failure in glusterfs_ctx_defaults_init()Vijay Bellur2014-12-092-7/+20
| | | | | | | | | | | | | This got introduced due to 656711d935000c16. Coverity also picked this up as CIDs 1256176, 1256178, 1256180. Signed-off-by: Vijay Bellur <vbellur@redhat.com> Change-Id: If12fa0075634383975846181917a2f9650f790e3 BUG: 789278 Reviewed-on: http://review.gluster.org/9213 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
* glusterd: Coverity fix for string_overflow overrunGauravKumarGarg2014-12-082-3/+3
| | | | | | | | | | | | | | | | | | | | In function glusterd_dump_peer() it is copying "input_key" into "key" buffer without checking the length which might cause string_overflow overrun. Similar problem with other coverity issue. With this fix it will copy "input_key" into "key" buffer by maximum length of buffer. Coverity CID: 1256171 Coverity CID: 1256172 Coverity CID: 1256174 Change-Id: I4e092309d9503bd79ff82cf83ed5e8d758743453 BUG: 1093692 Signed-off-by: Gaurav Kumar Garg ggarg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/9208 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
* gfapi: new inode created in glfs_resolve_component even if inode is in inode ↵Rajesh Joseph2014-12-081-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | table problem: USS allows split-brain file to be accessed while main volume gives I/O error. cause: AFR detects split-brain on lookup. It stores this information in inode context. open and readv fop checks this flag from inode context. open and readv fop fails if split-brain flag is set for the file. USS uses gfapi to access snapshot volume. During open call gfapi internally calls glfs_resolve_component. glfs_resolve_component generates a new inode even if inode is present for the file. Because of which afr_lookup acts on a new inode which does not contain the split-brain flag. Bug: 1171615 Change-Id: I1b4fddf4bd3c734a319ecfae804a3439866d157c Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-on: http://review.gluster.org/9253 Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-by: Poornima G <pgurusid@redhat.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* libgfapi: Wait for GF_EVENT_CHILD_DOWN in glfs_fini()Anoop C S2014-12-084-20/+66
| | | | | | | | | | | | | | | | | | | | | | Whenever glfs_fini() is being called, currently no check is made inside the function to determine whether the child is already down or not. This patch will wait for GF_EVENT_CHILD_DOWN for the active subvol and then exits. TBD: Apart from the active subvol, wait for other CHILD_DOWN events generated through operations like volume set in future. Change-Id: I81c64ac07b463bfed48bf306f9e8f46ba0f0a76f BUG: 1153610 Signed-off-by: Anoop C S <achiraya@redhat.com> Reviewed-on: http://review.gluster.org/9060 Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* rdma:vectored write fails for rdma.Mohammed Rafi KC2014-12-072-3/+3
| | | | | | | | | | | | | | | | | | | | For rdma write with payload count greater than one will fail due to insuffient memory to hold the buffers in rpc transport layer. It was expecting only one vector in payload, So it can only able to decode the first iovec from payload, and the rest will be discarded. Thnaks to Raghavendra Gowdappa for fixing the same. Change-Id: I82a649a34abe6320d6216c8ce73e69d9b5e99326 BUG: 1171142 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/9247 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* build: only install geo-rep scripts when enabledNiels de Vos2014-12-072-1/+7
| | | | | | | | | | | | | | When geo-replication is not enabled, the related scripts should not get installed. EPEL-5 does not support geo-replication, and the installed but unpackaged scripts cause rebuilding for .el5 to fail. BUG: 1169005 Change-Id: I1b6a352b73bd1ed1c5b330f54e26e81aed9a5a4e Reported-by: Lalatendu Mohanty <lmohanty@redhat.com> Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9221 Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* ec: Fix return errors when not enough bricksXavier Hernandez2014-12-058-14/+81
| | | | | | | | | | | | | | | | | | | | | Changes introduced by this patch: * Fix an incorrect error propagation when the state of the life cycle of a fop returns an error. * Fix incorrect unlocking of failed locks. * Return ENOTCONN if there aren't enough bricks online. * In readdir(p) check that the fd has been successfully open by a previous opendir. Change-Id: Ib44f25a1297849ebcbab839332f3b6359f275ebe BUG: 1162805 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/9098 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Fixed small typo in marker.cJan-Hendrik Zab2014-12-051-1/+1
| | | | | | | | | | Change-Id: Iec89e7141f6ff3216355d8a6b971617e16df679b BUG: 1075417 Signed-off-by: Jan-Hendrik Zab <zab@l3s.de> Reviewed-on: http://review.gluster.org/9238 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* uss/gluster: Send success on parent lookup of entry-pointvmallika2014-12-053-14/+107
| | | | | | | | | | | | | | | | | | When a lookup sent to snapview-server for entry-point directory protocol server first tries to resolve gfid of a parent directory. looking up the parent gfid from a latest snapshot can fail if the volume is a restored volume. As this gfid is already looked-up by snapview-client, we can return success for the parent gfid. Change-Id: Ic9b20561ef79b93032f07c3a81eae54a94e1747b BUG: 1162498 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/9229 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* cluster/afr: Eliminate locking in sh domain in metadata self-healKrutika Dhananjay2014-12-051-35/+2
| | | | | | | | | | Change-Id: I9ef25a17c9a43ba06fac2ad3f7c18cb47de91537 BUG: 1170913 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/9240 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>
* ec: Temporary fix for quota.tXavier Hernandez2014-12-041-0/+1
| | | | | | | | | | | | | | | This fix solves a problem with tests/basic/ec/quota.t that generates a segmentation fault in DHT. This is a temporary fix until bug #1167793 is solved. Change-Id: I8587e66a63375ba2b312e8c0bfa1dd0d94d4c19f BUG: 1129939 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/9222 Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* ec: Fix mutex related coverity scan issuesXavier Hernandez2014-12-041-2/+14
| | | | | | | | | | | | | | | | | | This patch solves 3 issues detected by coverity scan: CID1241484 Data race condition CID1241486 Data race condition CID1256173 Thread deadlock With this patch, inode lock is never acquired inside a region locked with fop->lock. Change-Id: I35c4633efd1b68b9f72b42661fa7c728b1f52c6a BUG: 1170254 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/9230 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com>
* ec: Fix incorrect value of EC_MAX_NODESXavier Hernandez2014-12-042-1/+4
| | | | | | | | | | | | | EC_MAX_NODES was incorrectly calculated. Now the value if computed as the minimum between the theoretical maximum and the limit imposed by the Galois Field. Change-Id: I75a8345147f344f051923d66be2c10d405370c7b BUG: 1167419 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/9193 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com>
* ec: Fix self-healing issues.Xavier Hernandez2014-12-0410-313/+548
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Three problems have been detected: 1. Self healing is executed in background, allowing the fop that detected the problem to continue without blocks nor delays. While this is quite interesting to avoid unnecessary delays, it can cause spurious failures of self-heal because it may try to recover a file inside a directory that a previous self-heal has not recovered yet, causing the file self-heal to fail. 2. When a partial self-heal is being executed on a directory, if a full self-heal is attempted, it won't be executed because another self-heal is already in process, so the directory won't be fully repaired. 3. Information contained in loc's of some fop's is not enough to do a complete self-heal. To solve these problems, I've made some changes: * Improved ec_loc_from_loc() to add all available information to a loc. * Before healing an entry, it's parent is checked and partially healed if necessary to avoid failures. * All heal requests received for the same inode while another self-heal is being processed are queued. When the first heal completes, all pending requests are answered using the results of the first heal (without full execution), unless the first heal was a partial heal. In this case all partial heals are answered, and the first full heal is processed normally. * An special virtual xattr (not physically stored on bricks) named 'trusted.ec.heal' has been created to allow synchronous self-heal of files. Now, the recommended way to heal an entire volume is this: find <mount> -d -exec getfattr -h -n trusted.ec.heal {} \; Some minor changes: * ec_loc_prepare() has been renamed to ec_loc_update(). * All loc management functions return 0 on success and -1 on error. * Do not delay fop unlocks if heal is needed. * Added basic ec xattrs initially on create, mkdir and mknod fops. * Some coding style changes Change-Id: I2a5fd9c57349a153710880d6ac4b1fa0c1475985 BUG: 1161588 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/9072 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com>
* protocol/server: No root-squash checks for self-heal pidPranith Kumar K2014-12-042-0/+26
| | | | | | | | | | | | | | | | | | Problem: Self-heal pid used to be -1 which was colliding with gsyncd. Gsyncd was not checked for root-squash authentication. Recently self-heal pid changed to -6, but root-squash authentication is not disabled for this. Fix: disable root-squash authentication for self-heal Change-Id: I93233d4ae681cb936d166b22992eb47c658ea977 BUG: 1170407 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/9231 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* features/index: closedir() if fd_ctx_set() fails in __index_fd_ctx_get.Vijay Bellur2014-12-041-0/+1
| | | | | | | | | | | Change-Id: I9ab599cf4a90c2e285d63ec0f56af210709285b6 BUG: 1166284 Signed-off-by: Vijay Bellur <vbellur@redhat.com> Reviewed-on: http://review.gluster.org/9168 Reviewed-by: Venky Shankar <vshankar@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>
* Regression test portability: basic/afr/resolve.tEmmanuel Dreyfus2014-12-041-1/+3
| | | | | | | | | | | | | | | | | | | | Final test in basic/afr/resolve.t checks for a failure after breaking the backend. But since the tested file was accessed just before that operations, it may still be in kernel page cache. As a result, file read is handled by kernel cache and never sent to the filesystem, and the test is successful where it should have failed. Fix this by waiting 10s before reading the supposed-to-be-broken file. BUG: 1129939 Change-Id: I97efc00bc8a5f954b1df786cdede468af8bf6485 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9075 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>
* Regression test portability: statEmmanuel Dreyfus2014-12-041-52/+51
| | | | | | | | | | | | | Improve Linux stat emulation for BSD so that it can handle multiple files at once. This is required now tests/basic/afr/data-self-heal.t uses that syntax. BUG: 1129939 Change-Id: I2720d0e8a0d4dedbb8d51fcde3586b4e7d8bb492 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9232 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* heal: free leaked frames.Ravishankar N2014-12-041-0/+2
| | | | | | | | | | | | | | | | | | | 'gluster v heal <VOLNAME> info` waits for about 10 seconds before printing the heal info and exiting. Problem: glfsh_process_entries() is not freeing the frames it created. Thus when glfs_fini() is called, it busy waits for 10 seconds for background frames to finish before returning error. Fix: Destroy the frames in that are created in glfsh_process_entries(). Change-Id: I5484d1b7301a355b913ae9c15b8a62471036c755 BUG: 1169335 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/9224 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>
* Glusterfs/posix: Stack corruption in posix_handle_pumpNithya Balachandran2014-12-031-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | posix_handle_pump can corrupt the stack if the buffer passed to it is too small to hold the final path. Fix : Check if the buffer is sufficiently large to hold the new path component before modifying it. This will prevent the buffer overrun but the path returned will most likely have too many symbolic links causing subsequent file ops to fail with ELOOP. The callers of this function do not currently check the return value. The code needs to be modified to have all callers check the return value and take appropriate action in case of an error. Change-Id: I6d9589195a4b0d971a107514ded6e97381e5982e BUG: 1113960 Signed-off-by: Nithya Balachandran <nbalacha@redhat.com> Reviewed-on: http://review.gluster.org/8189 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* tests: change license of arequal-checksum.c to include GPL v2.Ravishankar N2014-12-031-13/+4
| | | | | | | | | | | | In line with the licensing scheme of other files in the project. Change-Id: Ic4c7dfcd2f2ceaeda9ec05bd37de8ef49a1c6206 BUG: 1168207 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/9203 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* ec: Change licenseXavier Hernandez2014-12-0323-369/+138
| | | | | | | | | | Change-Id: Iae90ade2421898417b53dec0417a610cf306c44b BUG: 1168167 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/9201 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Regression test portability: stat(1)Emmanuel Dreyfus2014-12-032-1/+11
| | | | | | | | | | | | | | - Improve Linux stat(1) emulation for BSD: %t and %T should be 0 for non device nodes. - Remove what seems like a typo in entry-self-heal.t, which blocks in Linux stat(1) emulation for BSD. BUG: 1129939 Change-Id: I7635aa105e6d309cdb74608bdaba4135c7c00dd4 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9217 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Regression test portability: basic/file-snapshot.tEmmanuel Dreyfus2014-12-031-0/+7
| | | | | | | | | | | | | | | | | | | - For some odd reason, setfattr(1) could fail on big-file just after it was created by touch(1). Add a test in between to wait for the file to be visible by ls(1). - After switching to a snapshot, the file content is still in kernel cache, and the old content may be readen for a few seconds after the snapshot switch. Use ( cd $M0 && umount $M0 ) to flush vnodes and therefore invalidate the cache. - Unmount the mount point at the end of the test for the cleanliness sake. BUG: 1129939 Change-Id: I5a0d14db13e79323147761dfe50c41ae6a1cb844 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9220 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* uss: CIFS gives error while accessing .snaps directoryRajesh Joseph2014-12-034-24/+70
| | | | | | | | | | | | | | | | | | | | | CIFS sends getxattr call while accessing .snaps directory. snapview server should return ENODATA if getxattr is called on .snaps folder. Also flush on .snaps folder should be handled. Windows client sends and getxattr call on the parent folder of .snaps with a special key to get the real filename of a file. This is used by samba to do case insensitive check of files. Fixed few FreeBSD compilation error. bug: 1168875 Change-Id: I74d5cb4419568c8ed8709ba6d1ddff0e41392204 Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-on: http://review.gluster.org/9211 Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* tests: Data self-heal test casesPranith Kumar K2014-12-022-0/+213
| | | | | | | | | Change-Id: I74d08797b791ea6649d9aba585996e9ec680e3f8 BUG: 1128721 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8538 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Ravishankar N <ravishankar@redhat.com>
* glusterd: use synclock_t for synchronizing concurrent '\op_sm\' invocationsKrishnan Parthasarathi2014-12-011-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | In glusterd_op_sm(), we lock and unlock the gd_op_sm_lock mutex. Unfortunately, locking and unlocking can happen in different threads (task swap will occur in handler call with use of synctasks). This case is explictely covered by POSIX: the behavior is undefined. http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_lock.html When unlocking from a thread that is not owner, Linux seems to be fine (though you never know with unspecified operation), while NetBSD returns EPERM, causing a spurious error in tests/basic/pump. To fix this, we use synclock_t which was precisely meant for this. synclock is a pthread_mutex_t like synchronization object which uses the synctask handle for owner and is immune to the task being run on multiple threads during its lifetime. Change-Id: Idca15190d42f32a843088cc8236138f676377586 BUG: 1129939 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/9212 Reviewed-by: Kaushal M <kaushal@redhat.com> Tested-by: Kaushal M <kaushal@redhat.com>
* mgmt/glusterd: Out of bounds access to fs_info structPetr Medonos2014-12-011-1/+1
| | | | | | | | | | | Change-Id: Ifa0d4ac17f9da94660a7b7f567a0f07b5cec7aec BUG: 1164775 Signed-off-by: Petr Medonos <petr.medonos@etnetera.cz> Reviewed-on: http://review.gluster.org/9138 Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
* USS : fill proper uid and gid during a access call from nfsSachin Pandit2014-12-012-1/+207
| | | | | | | | | | | | | | | | | | | | Problem : when an user tries to access a file/folder for which he does not have a proper permission required then fuse gives out a proper error "Permission denied", but nfs does not give out that error, rather he can access the file/folder. The reason being uid and gid of call frame stack takes a default value of uid and gid which point to root permission. Solution : Set a proper uid and gid during a access call from nfs Change-Id: Ib060706fde66ec7e60f242fab1f3e59122ed2245 BUG: 1167580 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/9194 Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* glusterd/uss: Create rebalance volfile.Avra Sengupta2014-11-305-21/+117
| | | | | | | | | | | | | | | | | | | | Create a new rebalance volfile, which will not contain snap-view client translators, irrespective of the status of USS. This volfile, will be created and regenerated everytime the fuse-volfile is generated, and will be consumed by the rebalance process. Change-Id: I514a8e88d06c0b8fb6949c3a3e6dc4dbe55e38af BUG: 1164711 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/9190 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: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* glusterd/uss: if snapd is not running, return success from ↵Atin Mukherjee2014-11-302-0/+33
| | | | | | | | | | | | | | | | | | glusterd_handle_snapd_option glusterd_handle_snapd_option was returning failure if snapd is not running because of which gluster commands were failing. Change-Id: I22286f4ecf28b57dfb6fb8ceb52ca8bdc66aec5d BUG: 1168803 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/9206 Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>