summaryrefslogtreecommitdiffstats
path: root/xlators/features
Commit message (Collapse)AuthorAgeFilesLines
* mgmt/glusterd: Add option to enable lock tracePranith Kumar K2014-12-281-10/+15
| | | | | | | | | | | Change-Id: I24ed0f866d53e91a8323c043a38f73207cbfd7d2 BUG: 1168189 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/9351 Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* quota: For a rename operation, do quota_check_limit only till thevmallika2014-12-272-54/+291
| | | | | | | | | | | | | | | | | | | | | | | | common ancestor of src and dst file Example: set quota limit set to 1GB on / create a file /a1/b1/file1 of 600MB mv /a1/b1/file1 /a1/b1/file2 This rename fails as it takes delta into account which sums up to 1.2BG. Though we are not creating new file, we still get quota exceeded error. So quota enforce should happen only till b1. Similarly: mv /a/b/c/file /a/b/x/y/file quota enforce should happen only till dir 'b' Change-Id: Ia1e5363da876c3d71bd424e67a8bb28b7ac1c7c1 BUG: 1153964 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/8940 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* features/locks: Add lk-owner checks in entrylkPranith Kumar K2014-12-262-21/+54
| | | | | | | | | | | | | For backward compatibility of entry-self-heal we need entrylks to be accepted by same lk-owner and same client. This patch introduces these changes. Change-Id: I67004cc5e657ba5ac09ceefbea823afdf06929e0 BUG: 1168189 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/9125 Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* features/marker: log message clean upVijay Bellur2014-12-252-21/+18
| | | | | | | | | | | | | | | | | 1. Changed log messages to be more appropriate. 2. Changed loglevel of failures in fop_cbks to be recorded as TRACE. Logging of failures at higher loglevels is unessential in non-endpoint translators. 3. Removed a log message related to memory allocation failure. BUG: 1174087 Change-Id: I63c560c3bbd12706357fb3f696378c1a1e1efb44 Signed-off-by: Vijay Bellur <vbellur@redhat.com> Reviewed-on: http://review.gluster.org/8168 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* telldir()/seekdir() portability fixesEmmanuel Dreyfus2014-12-172-13/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* 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>
* build: FreeBSD 11-Current causes libtool to fail with '-shared'Harshavardhana2014-12-123-4/+4
| | | | | | | | | | | | 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>
* features/snapview-client: handle readdir requests differently for sambaRaghavendra Bhat2014-12-094-9/+569
| | | | | | | | | | | * 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>
* 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-052-14/+51
| | | | | | | | | | | | | | | | | | 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>
* 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>
* 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>
* USS : fill proper uid and gid during a access call from nfsSachin Pandit2014-12-011-1/+6
| | | | | | | | | | | | | | | | | | | | 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>
* gluster/uss: Handle notify in snapview-clientvmallika2014-11-281-0/+25
| | | | | | | | | | | | | | | As there are two subvolumes in snapview-client, there is a possibility that the regular subvolume is still down and snapd subvolume come up first. So if we don't handle this situation CHILD_UP event will be propagated upwards to fuse when regular subvolume is still down. This can cause data unavailable for the application Change-Id: I9e5166ed22c2cf637c15db0457c2b57ca044078e BUG: 1168643 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/9205 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* gluster/uss: Handle ESTALE in snapview client when NFS server restartedvmallika2014-11-252-13/+30
| | | | | | | | | | | | | | | When NFS server is restarted inode-context is lost. Nameless lookup will be sent to regular volume. If the gfid is from virtual graph, lookup will fail with ESTALE. We need to send a lookup to snapview server Change-Id: I22920614f0d14cb90b53653fce95b6b70023eba6 BUG: 1166197 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/9153 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Sachin Pandit <spandit@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* changelog: correct mmap() error checkingNiels de Vos2014-11-171-8/+6
| | | | | | | | | | | | | | | Upon failure, mmap() returns MAP_FAILED, which is not equal to NULL. This small correction makes sure that the potential error gets caught and handled. BUG: 1138621 Change-Id: I0a88b5187afa7187dcaa8f7d2cb0f9bb775c929d Reported-by: Santosh Pradhan <santosh.pradhan@gmail.com> Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9130 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com>
* gluster/uss: Don't send failure when accessing snap with namevmallika2014-11-171-14/+2
| | | | | | | | | | | | | | | | | | same as entry-point name In a scenario, if the snap name is same as the snap-directory than cd to snaps/snaps fails. Send a lookup to snap-view server instead of failing Change-Id: Ie7b811815ff30961500592bbc8cdb514a9d76ef5 BUG: 1164613 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/9135 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* uss/snapd: Handle readlink fops on snap view serverAvra Sengupta2014-11-141-0/+1
| | | | | | | | | | | | | Handle readlink fops in case of symlinks on snap view server BUG: 1162462 Change-Id: Ia08e9e9c1c61e06132732aa580c5a9fd5e7c449b Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/9102 Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* uss/gluster: creating file/directories inside .snaps should fail withvmallika2014-11-134-27/+37
| | | | | | | | | | | | | | | EROFS When an attempt is made to create file/directories inside .snaps, it fails with wrong error message as "Stale file handle". It should fail with "Read-only file system" Change-Id: I3a812a0afc4762cbb71ab180b9394c866e576a66 BUG: 1159840 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/9039 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* uss/gluster: Move all uss related logs into subfoldervmallika2014-11-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | For USS we have 1 snapd log per volume and as many snap logs for volume. For example if there are 4 volumes having 256 snaps each and USS is enabled than total number of logs under /var/log/glusterfs for USS would be 1028 logs. Total logs = (4(snapd per volume) + 4(volumes)*256(snaps)) = 1028 Hence, it makes sense to move into into sub-folder structure like /var/log/glusterfs/snaps/<vol-name>/<snapd + snaps logs> Change-Id: I29262e6458c3906916923cd67d1145d6ae10bec3 BUG: 1160534 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/9050 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* USS : Display only the activated snapshotsSachin Pandit2014-11-122-41/+62
| | | | | | | | | | | | | | | Instead of displaying all the snapshots in the uss world, it is better if we display only the activated snapshots. Change-Id: I70d3ec212b62ec15956ae3e826bc4201d8dedd17 BUG: 1155042 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/8958 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* features/marker: Filter internal xattrs in lookupPranith Kumar K2014-11-111-32/+77
| | | | | | | | | | | | | Afr should ignore quota-size-key as part of self-heal but should heal quota-limit key. Change-Id: Ic0b06bd20a563a00d6bfdc2dc5a76c661e533ecb BUG: 1161106 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/9061 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* feature/gfid-access: Always send setattr down in overloaded setxattr.Kotresh HR2014-11-071-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: File ownership is not being preserved for root in geo-rep mountbroker setup. Analysis and Cause: Entry creations for geo-rep is overloaded in ga_setxattr. It happens in two phase, entry creation followed by setattr to preserve ownership as in master. If uid and gid of file being synced is root, setattr was not being sent down. Since, the file creation happens with non-root user in mountborker geo-rep setup, if setattr is not done explicitly, file ownership is not preserved for root. Solution: Always pass setattr down in overloaded ga_setxattr. Change-Id: I062215c1b2379d515f28ec7f271077ad37182c7e BUG: 1104954 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/9051 Reviewed-by: Aravinda VK <avishwan@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>
* barrier: Correct gfid in statedump of barriered fopsggarg2014-11-062-14/+145
| | | | | | | | | | | | | | | | In brick statedump file the barriered fop's gfid was showing 0 when statedump was taken. This is because of statedump code was not referring to correct gfid. With this change statedump code will use correct gfid and gfid will not be 0 in statedump file when barrier is enable and user takes statedump of volume. Change-Id: Ia296cba7e132402df53c602daa160c1c2cd21245 BUG: 1099369 Reviewed-on: http://review.gluster.org/7893 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
* glupy: portability fixesEmmanuel Dreyfus2014-11-053-13/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes portability problems so that NetBSD passes tests/features/glupy.t - Use python-config to detect python build environment on all systems, not just Linux and Darwin. - Get the site-package directory from python and make sure we install glupy.py there, Previously we installed within glusterfs prefix, which caused a problem if it was different that python's prefix. - Set PYTHONPATH for tests so that the detected site-packages is used in python's search path. This should be useless, but let us have it just in case. - Pass glupy.so path from glusterfsd to glupy.py through an environment variable and use it in CDLL instead of "", as the later seems not portable (at least it fails on NetBSD). - Use gil_init_key pthread_getspecific to avoid deadlocks (that code was #ifdef out, perhaps because it was not needed on Linux, but it seems to be required for NetBSD. - Recover the error message from Python and send it to the logs to help debugging problems. BUG: 1129939 Change-Id: Icc71e77d6940f0759cc14c5c5cf7ca6fa431e0d2 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8978 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
* features/snapview-server: verify the fs instance in revalidated lookups as wellRaghavendra Bhat2014-10-301-7/+53
| | | | | | | | | Change-Id: Id5f9d5a23eb5932a0a53520b08ffba258952e000 BUG: 1151004 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/8999 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* feature/changelog: Fix changelog missing SETATTR entries.Kotresh HR2014-10-292-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | Problem: Valid SETATTR entries are missing in changelog when more than one metadata operation happen on same inode within changelog roll-over time. Cause: Metadata entries with fop num being GF_FOP_NULL are logged in changelog which is of no use. Since slice version checking is done for metadata entries to avoid logging of subsequent entries of same inode falling into same changelog, if the entry with GF_FOP_NULL is logged first, subsequent valid ones will be missed. Solution: Have a boundary condition to log only those fops whose fop number falls between GF_FOP_NULL and GF_FOP_MAXVALUE. Change-Id: Iff585ea573ac5e521a361541c6646225943f0b2d BUG: 1104954 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/8964 Reviewed-by: Aravinda VK <avishwan@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>
* changelog: replace MAKE_HTIME_FILE_PATH with snprintf()Niels de Vos2014-10-281-7/+1
| | | | | | | | | | | | | | | | The used once MAKE_HTIME_FILE_PATH macro uses strcpy and strcat into a fixed buffer without checking the input lengths. Recommend replacing with a snprintf. Change-Id: Ia0245096774dc84be1b937e1d5750f3634fff034 BUG: 1099645 Reported-by: Keith Schincke <kschinck@redhat.com> Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/8977 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com>
* features/snapview-server: check if the reference to the snapshot world isRaghavendra Bhat2014-10-282-8/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | correct before doing any fop The following operations might lead to problems: * Create a file on the glusterfs mount point * Create a snapshot (say "snap1") * Access the contents of the snapshot * Delete the file from the mount point * Delete the snapshot "snap1" * Create a new snapshot "snap1" Now accessing the new snapshot "snap1" gives problems. Because the inode and dentry created for snap1 would not be deleted upon the deletion of the snapshot (as deletion of snapshot is a gluster cli operation, not a fop). So next time upon creation of a new snap with same name, the previous inode and dentry itself will be used. But the inode context contains old information about the glfs_t instance and the handle in the gfapi world. Directly accessing them without proper check leads to ENOTCONN errors. Thus the glfs_t instance should be checked before accessing. If its wrong, then right instance should be obtained by doing the lookup. Change-Id: Idca0c8015ff632447cea206a4807d8ef968424fa BUG: 1151004 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/8917 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Fix invalid seekdir() usageEmmanuel Dreyfus2014-09-301-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to POSIX, seekdir() should only be given offset obtained from telldir() on the same DIR * http://pubs.opengroup.org/onlinepubs/9699919799/functions/seekdir.html Code from afr-self-heald.c and index.c is operating outside of the specification, by doing using seekdir() with offset from a previously open/close/re-open directory. This seems to work on Linux (although with no guarantee it will always in the future). On NetBSD the seekdir() with a in invalid offset is a nilpotent operation, and causes an infinite loop, since index_fill_readdir() always restart from the beginning of the directory. The situation is fixed by using a non anonymous fd in afr-self-heald.c: we explicitely open the directory so that it remains open on the brick side during the timeframe where we want to reuse offsets in seekdir(). This requires adding an opendir fop in index xlator. If the brick was not updated, the opendir will fail and we fallback to the standard violating approach for backward compatibility on Linux. On other systems we fail since it never worked. While there, add tests to check seekdir() success in index and posix xlators, so that incorrect usage from calling code produce an explicit error instead of an infinite loop. We can only do it on non Linux systems, for the sake of backward compatibility when the brick was updated but not the client. BUG: 1129939 Change-Id: I88ca90acfcfee280988124bd6addc1a1893ca7ab Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8760 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* USS : Decide the log entry based on the type of graph.Sachin Pandit2014-09-291-5/+12
| | | | | | | | | | | | | | | | | | Problem : When a lookup is issued, and if the entry is not found then snapview-client will log failure stating that "Lookup on normal graph failed with error Stale file handle" irrespective of type of graph it received call back from. Solution : Introduced a check to find out the graph from which the snapview-client received call-back. Change-Id: Iadd5b525c394be3675d40231711058e1cf1396cd BUG: 1146479 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/8851 Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Do not assume sizeof(size_t)Emmanuel Dreyfus2014-09-162-2/+2
| | | | | | | | | | | | | | | This fixes an assumption that sizeof(size_t) == sizeof(uint64_t), which is not guaranteed. At least on NetBSD/i386, size_t is 32 bit long. Caught by tests/basics/file-snapshot.t BUG: 764655 Change-Id: Ib7620a2ffe8758521886af37bc280101a040d860 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8441 Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com>
* features/quota: fixes to dentry management code in rename.Raghavendra G2014-09-151-10/+6
| | | | | | | | | | | | | | | | | | 1. After a successful rename (src, dst), the dentry <dst-parent, dst-basename> would be associated with src-inode. 2. Its src inode that survives if both of src and dst are present. The fixes are done based on the above two observation. Change-Id: I7492a512e3732b1455c243b02fae12d489532bfb BUG: 1140084 Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-on: http://review.gluster.org/8687 Reviewed-by: susant palai <spalai@redhat.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* snapview-server: get the handle if its absent before doing any fopRaghavendra Bhat2014-09-122-29/+160
| | | | | | | | | | | | | | | | | | | | | | | * Now that NFS server does inode linking in readdirp, it can resolve the gfid (i.e. find the right inode from its inode table) present in the filehandle sent by the NFS client on which a fop came. So instead of sending the lookup on that entry, it directly sends the fop. But snapview-server does not get the handle for the entries in readdirp (because doing a lookup on each entry via gfapi would be costly. So it waits till a lookup is done on that inode, to get the handle and the fs instance and fill it in the inode context). So when NFS resoves the gfid and directly sends the fop, snapview-server will not be able to perform the fop as the inode contet would not contain the fs instance and the handle. So fops should check for the handle before doing gfapi calls. If the handle and fs instance are not present in the inode context they should get them by doing an explicit lookup on the entry. Change-Id: Idd648fbcc3ff6aadc3b63ff236561ca967b92f5d BUG: 1115949 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/8324 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* quota/marker: Fix dict leaksRavishankar N2014-09-094-17/+23
| | | | | | | | | | | | | Unref dicts in quota and marker functions before they return. Change-Id: I772edc7b46657a70fb136e037576c65e9beeaca8 BUG: 1139327 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/8655 Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* snapview-server: register a callback with glusterd to get notificationsRaghavendra Bhat2014-09-086-1117/+1186
| | | | | | | | | | | | | | | * As of now snapview-server is polling (sending rpc requests to glusterd) to get the latest list of snapshots at some regular time intervals (non configurable). Instead of that register a callback with glusterd so that glusterd sends notifications to snapd whenever a snapshot is created/deleted and snapview-server can configure itself. Change-Id: I17a274fd2ab487d030678f0077feb2b0f35e5896 BUG: 1119628 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/8150 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Always check for ENODATA with ENOATTREmmanuel Dreyfus2014-09-081-3/+3
| | | | | | | | | | | | | | | | | | Linux defines ENODATA and ENOATTR with the same value, which means that code can miss on on the two without breaking. FreeBSD does not have ENODATA and GlusterFS defines it as ENOATTR just like Linux does. On NetBSD, ENODATA != ENOATTR, hence we need to check for both values to get portable behavior. BUG: 764655 Change-Id: I003a3af055fdad285d235f2a0c192c9cce56fab8 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8447 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* Build fix: -lz for qemu-block xlatorEmmanuel Dreyfus2014-09-051-1/+1
| | | | | | | | | | | | | | | LIBZ_LIBS has been changed into ZLIB_LIBS everywhere in the sources, except in qemu-block xlator. Fix it so that it can find -lz and link correctly. BUG: 1129939 Change-Id: I34ded175f056d1a0898804fe602e3d2d2cba27f5 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8623 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Harshavardhana <harsha@harshavardhana.net>
* 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>