summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* storage/posix: Set correct fsgid before doing symlinkPranith Kumar K2015-01-121-2/+2
| | | | | | | | | | Change-Id: Ic50dfa5e5084c7b148e42a5014cca2b47c8ab5ed BUG: 1180986 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/9431 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
* api: versioned symbols in libgfapi.so for compatibilityKaleb S. KEITHLEY2015-01-1215-313/+828
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use versioned symbols to keep libgfapi at libgfapi.so.0.0.0 Revisited to address broken build on Mac OS X See http://review.gluster.org/9036 Rebased to include http://review.gluster.org/#/c/9376/ (glfs_resolve()) but note that gerrit's "Rebase Change" couldn't do it. N.B. noticed that glfs_get_volumeid() decl in glfs.h was missing the __THROW, added it. On systems using ELF and the GNU toolchain, symbol versions are created with a .symver asm operand in the .c source file. Clang is claimed to be compatible with gcc, so we'll pretend for now that this also works with clang. On Mac OS X, aliases are created with __asm "magic" in the .h header file. In the normal case, when both the decl and defn match, that's all that's needed. In our case though the decl and defn don't match --- we have, e.g. a defn such as 'int glfs_foo(...)' and the corresponding decl is 'int pub_glfs_foo(...)'. To make this work we create the necessary aliases in the library at link time with the -alias_list link option. Note that this results in there being pairs of symbols in the .dylib, e.g. _pub_glfs_foo and _glfs_foo$GFAPI_3.4.0. We could use another link option, -unexported_symbols_list to elide the _pub_glfs_* symbols. (And we probably should.) Linux symbol versioning was essentially copied from Solaris; in general I would expect this to "just work" on Solaris, but until someone tries we don't really know. Change-Id: Icb96a3c2d80be7b6d7a6849bb9168f03a947f47c BUG: 1160709 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/9143 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: glusterd socket files should reside in /var/run/glusterAtin Mukherjee2015-01-121-1/+1
| | | | | | | | | | | | | glusterfs socket files should not reside outside of gluster folder. Change-Id: I5d7b43b11c8c78a32df8aaf38917b80e4e33c9d0 BUG: 1180972 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/9423 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* tests: ancestry building quota tests on fuse mountPranith Kumar K2015-01-111-0/+63
| | | | | | | | | | | | | | | | quota-anon-fd-nfs.t is essentially testing ancestry building code path and quota limit reaching. Since nfs client and server on same machine leads to deadlocks, it is better to use fuse mount to trigger these code paths. Just stop the volume and start again, this wipes the inode table clean. Performing writes after this will trigger ancestry building + quota checks. Change-Id: I2d37a8662040a638d3fac3f9535d32498a5b434d BUG: 1163543 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/9408 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* Spare spurious regression in quota.tEmmanuel Dreyfus2015-01-103-3/+6
| | | | | | | | | | | | | Like quota-nfs.t, quota.t shows spurious regressions because dd writes too fast. Reuse the C program used by quota-nfs.t to write slowly, and rename it to show it is not specific to quota-nfs.t BUG: 1129939 Change-Id: I14b50e368023e88dc8bcc76c266cc908d62f89e2 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9410 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* transport: fix default behavior for SSL authorizationJeff Darcy2015-01-094-2/+51
| | | | | | | | | | | | | | | | | | | | Previously, enabling SSL authentication/encryption but not authorization required explicitly setting ssl-allow=*. Now that same behavior is the default (i.e. when ssl-allow is not set). Also, there's no reason that a name used for *login* auth (typically a UUID for internal purposes or a human name when using SSL) should validate as an RFC-compliant host name or IP address. Therefore the validation only occurs when the auth type is "addr" (not "login" or anything else). Change-Id: I01485ff4f0ab37de4b182858235a5fb0cf4c3c7d BUG: 1179208 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/9397 Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Fix bad shell calculation in tests/basiv/afr/self-heald.tEmmanuel Dreyfus2015-01-091-1/+1
| | | | | | | | | | | | | | | | | A shell variable calculation in tests/basiv/afr/self-heald.t resulted in spurious regression failure at test 67. This is wrong and always produce an error: $((`date +"%j"`))%2 This still fails because date +"%j" produces 008, which is considered an octal value: $((`date +"%j"` %2 )) This works: $((`date +"%j"|sed 's/^0*//'` % 2 )) BUG: 1129939 Change-Id: I5d0d27b7bb64ef7d56bafebe71aafe01eb2f39a7 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9414 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* ec: Remove O_APPEND from flags on create and open.Xavier Hernandez2015-01-095-53/+103
| | | | | | | | | | | | | | | | | | | Allowing O_APPEND flag to pass through to the brick files corrupts fragment contents because writes are not stored on the desired place. Write fop has been modified so that it uses current file size as its write offset. This guarantees that all writes, even those comming from different file descriptors and clients, will write to the end of the file. Change-Id: I9f721f12217a98231fe52e344166d1c94172c272 BUG: 1161621 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/9079 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* protocol/server: Fix possible memory leaks of xdataXavier Hernandez2015-01-091-4/+13
| | | | | | | | | | | | | There was a memory leak of xdata argument in fops (f)setxattr, (f)xattrop and statfs. This leak was minor because xdata is rarely, or even not used at all, in this fops. Change-Id: Ie1083ae227755a11cf72f8d89595520a5afb3042 BUG: 1127653 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/8434 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* feature/changelog: Logging entry as well for explicit sync virtual xattr.Kotresh HR2015-01-093-7/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an improvement over the patch 'http://review.gluster.org/9337' to trigger explicit geo-rep sync on regular files even if entry is not present on the slave. An attempt is made to find the pargfid and if available captures CREATE along with DATA in changelog. CREATE is captured with default file permissions. Setting this virtual setxattr on directories captures MKDIR in changelog. The value of setxattr can be as follows. If value = "1" : Both CREATE and DATA is captured in changelog if pargfid is available, else on DATA is captured. value = "any other: ENOTSUP is returned. Usage: setfattr -n glusterfs.geo-rep.trigger-sync -v "1" <file-path> NOTE: This patch supports explicit record of entries only for directories and regular files. Change-Id: Iedde8b2c8bc3b78db524050d8c866ff664811d01 BUG: 1176934 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/9370 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com>
* cluster/ec: Handle internal xattr get/setPranith Kumar K2015-01-087-115/+233
| | | | | | | | | | | | | | | | | | | | Problem: Internal xattrs of EC like trusted.ec.size/config/version can be modified by users and that can lead to misbehavior in EC. Fix: Don't let the user modify the xattrs. Hide these xattrs in getfattr outputs. Change-Id: I39cec96ae12826b506b496fda7da74201015fd75 BUG: 1178688 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/9385 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org> Tested-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
* cluster/ec: Do not modify quota, selinux xattrs in healingPranith Kumar K2015-01-081-14/+38
| | | | | | | | | | | | | | | | | Problem: EC heal tries to heal quota-size, selinux xattrs as well. quota-size is private to the brick but since quotad accesses them using the standard interface as well, they can not be filtered in the fops. Fix: Ignore QUOTA_SIZE_KEY and SELINUX xattrs during heal. Change-Id: I1572f9e2fcba7f120b4265e034953a15ff297f04 BUG: 1179640 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/9401 Reviewed-by: Xavier Hernandez <xhernandez@datalab.es> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* glusterd: use list_for_each_entry_safe for cleanupAvra Sengupta2015-01-081-3/+4
| | | | | | | | | | | | | | Use list_for_each_entry_safe() instead of list_for_each_entry() for cleanup of local xaction_peers list. Change-Id: I6d70c04dfb90cbbcd8d9fc4155b8e5e7d7612460 BUG: 1173414 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/9416 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* glusterd: Refactor glusterd-utils.cAvra Sengupta2015-01-0816-3879/+3942
| | | | | | | | | | | | | | | | Refactor glusterd-utils.c to create glusterd-snapshot-utils.c consisting of all snapshot utility functions. Change-Id: Id9823a2aec9b115f9c040c9940f288d4fe753d9b BUG: 1176770 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/9391 Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@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>
* avoid memory leaks in snapview-serverRaghavendra Bhat2015-01-081-0/+3
| | | | | | | | | | | | | * snapview-server in readdirp, creates the inode for entries with names "." and ".." for each readdirp operation without creating dentries leading to memleak. It should have avoided creation of inodes for those entries Change-Id: I3b2025fd10872fcc3303d0becec764ffd4e37601 BUG: 1179663 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/9404 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* test : removing quota-anon-fd-nfs.t for time being.Sachin Pandit2015-01-061-86/+0
| | | | | | | | | | | | | | | I am removing quota-anon-fd-nfs.t for time being as it is causing lots of regression failure. Meanwhile I will be working in parallel to find out the root cause for this spurious failure in another patch (http://review.gluster.org/#/c/9381/). I'll revert this patch once a proper fix is found. Change-Id: I0ef205241219ed3210d58d2b487f1b00292115f0 BUG: 1163543 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/9390 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* api: export glfs_resolve()Ravishankar N2015-01-064-17/+18
| | | | | | | | | | | | | | | | | glfs_resolve() is an internal function in libgfapi. Export it so that it can be used by glfs-heal.c. The change is done in line with the approach followed in commit 7e497871d11a3a527e2ce192e4274322631f27d0 (http://review.gluster.org/9036) This patch [2/3] is required as a part of afr automated split-brain resolution implementation. Change-Id: If9057f2a037fd25a0dfa231683bfbaa72d3cb1b2 BUG: 1136769 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/9376 Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Tested-by: Shyamsundar Ranganathan <srangana@redhat.com>
* glusterd: cluster quorum count check correctionAtin Mukherjee2015-01-065-27/+50
| | | | | | | | | | | | | | | | | Due to the recent change introduced by commit da9deb54df91dedc51ebe165f3a0be646455cb5b cluster quorum count calucation now depends on whether the peer list is either all peers or global transaction peer list or the local transaction peer list. Change-Id: I9f63af9a0cb3cfd6369b050247d0ef3ac93d760f BUG: 1173414 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/9350 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
* tests: move all test-cases into component subdirectoriesNiels de Vos2015-01-06271-609/+619
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are around 300 regression tests, 250 being in tests/bugs. Running partial set of tests/bugs is not easy because this is a flat directory with almost all tests inside. It would be valuable to make partial test/bugs easier, and allow the use of mulitple build hosts for a single commit, each running a subset of the tests for a quicker result. Additional changes made: - correct the include path for *.rc shell libraries and *.py utils - make the testcases pass checkpatch - arequal-checksum in afr/self-heal.t was never executed, now it is - include.rc now complains loudly if it fails to find env.rc Change-Id: I26ffd067e9853d3be1fd63b2f37d8aa0fd1b4fea BUG: 1178685 Reported-by: Emmanuel Dreyfus <manu@netbsd.org> Reported-by: Atin Mukherjee <amukherj@redhat.com> URL: http://www.gluster.org/pipermail/gluster-devel/2014-December/043414.html Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9353 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* libglusterfs: change signature of syncop_(f)getxattrRavishankar N2015-01-0512-30/+39
| | | | | | | | | | | | | | | | | Pass xdata dict to syncop_(f)getxattr calls. This patch [1/3] is required as a part of afr automated split-brain resolution implementation. Change-Id: I3970b3dd6daf64681a031e37f8e9afb14fb3d668 BUG: 1136769 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/9375 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* cli: logging improvementsVijay Bellur2015-01-053-5/+5
| | | | | | | | | | | | | | | | | | | | | | 1. cli used to log messages at all log levels. This is related to a peculiar behavior of gcc which treats any enum variable whose type has non-negative only defined values to be an unsigned integer. This would cause cli's loglevel (defaulted from state->loglevel) to be set as (uint)-1 previously and hence all log messages across levels would appear in the cli log file. Now cli's loglevel defaults to log level INFO. 2. Changed logging level of messages of type "Returning %d".. to DEBUG. Change-Id: I05094e523fc277d9ad32cc9d76aee873c0fd3859 BUG: 1168809 Signed-off-by: Vijay Bellur <vbellur@redhat.com> Reviewed-on: http://review.gluster.org/9383 Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@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>
* cluster/afr: serialize inode locksPranith Kumar K2015-01-042-60/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Afr winds inodelk calls without any order, so blocking inodelks from two different mounts can lead to dead lock when mount1 gets the lock on brick-1 and blocked on brick-2 where as mount2 gets lock on brick-2 and blocked on brick-1 Fix: Serialize the inodelks whether they are blocking inodelks or non-blocking inodelks. Non-blocking locks also need to be serialized. Otherwise there is a chance that both the mounts which issued same non-blocking inodelk may endup not acquiring the lock on any-brick. Ex: Mount1 and Mount2 request for full length lock on file f1. Mount1 afr may acquire the partial lock on brick-1 and may not acquire the lock on brick-2 because Mount2 already got the lock on brick-2, vice versa. Since both the mounts only got partial locks, afr treats them as failure in gaining the locks and unwinds with EAGAIN errno. Change-Id: Ie6cc3d564638ab3aad586f9a4064d81e42d52aef BUG: 1176008 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/9372 Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
* tests: return non-zero value instead of exit in functions within the test runAtin Mukherjee2015-01-021-21/+21
| | | | | | | | | | | | | using 'exit 1' would terminate the test script which means cleanup will never get triggered for that test run which is incorrect. Instead use 'return 1'. Change-Id: I48c36cff4b2ddfcc2bd8ceb85484720161fe58f0 BUG: 1163543 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/9333 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com>
* features/uss: Perform NULL check on @name in svc_getxattrKrutika Dhananjay2015-01-022-1/+28
| | | | | | | | | | | | | | | | | | | LISTXATTR fop is internally converted into a GETXATTR with the "name" parameter set to NULL. In svc_getxattr(), a listxattr was causing a crash because of a NULL pointer dereference on @name. FIX: Add the necessary NULL check. Change-Id: I70024d40dc0695648c6d41b423c2665d030e1232 BUG: 1178079 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/9378 Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Sachin Pandit <spandit@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Do not use umount -l on non Linux systemsEmmanuel Dreyfus2015-01-021-2/+4
| | | | | | | | | | | | | | Lazy unmount are only supported on Linux. Force umount instead, since this code path is used in emergency exit anyway. On NetBSD, just have the filesystem calling exit, the kernel will unmount. BUG: 1129939 Change-Id: If623ebf60b7a747ea7e78034b6d71ec2241dea4a Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9334 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* afr: Fixes to commit 85427a23c238499137cbfaafdb7b6ad27f67506aAnuradha2015-01-014-1/+18
| | | | | | | | | | | | | * Fixed a dict leak * Re-added 'return on failure' check Change-Id: I07edd03e4608fd2b7c4a91019a0e43033e6e78b2 BUG: 1163804 Signed-off-by: Anuradha <atalur@redhat.com> Reviewed-on: http://review.gluster.org/9368 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>
* build: Remove files completely in make uninstall.Raghavendra Talur2015-01-012-0/+6
| | | | | | | | | | | | If we create symlinks are part of make install, should remove them as part of make uninstall. Change-Id: Ie6e641caed60104cd256de4f020c1c6743d4ae60 BUG: 1177767 Signed-off-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-on: http://review.gluster.org/9367 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* doc: added did-you-know.md to document the less-knownKrishnan Parthasarathi2014-12-311-0/+36
| | | | | | | | | | | behaviours and features of GlusterFS Change-Id: Ibabc6398be9fb1c20127aaad2c51a629fed7c10b Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/9103 Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com> Tested-by: Lalatendu Mohanty <lmohanty@redhat.com>
* test: Make gfid-access.py more generic.Kotresh HR2014-12-312-8/+12
| | | | | | | | | | | | | | | Few of the hard coded values, uid, gid and file permissions are made as arguments to make the script more generic. Also fixes the permission issue which was hard coded as integer instead of octal. Change-Id: Icec700770de2b7cae00e02f783d072860e6d5e2b BUG: 1176934 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/9366 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Aravinda VK <avishwan@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* geo-rep: Error handling in tar+ssh modeAravinda VK2014-12-291-12/+12
| | | | | | | | | | | | | | | | | | | | | | | Georep raises exception if tar+ssh fails and worker dies due to the exception. This patch adds resilience to tar+ssh error and geo-rep worker retries when error, and skips those changelogs after maximum retries.(same as rsync mode) Removed warning messages for each rsync/tar+ssh failure per GFID, since skipped list will be populated after Max retry. Retry changelog files log also available, hence warning message for each GFID is redundent. BUG: 1177527 Change-Id: I3019c5c1ada7fc0822e4b14831512d283755b1ea Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/9356 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kotresh HR <khiremat@redhat.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com>
* feature/changelog: Virtual xattr to trigger explicit sync in geo-rep.Kotresh HR2014-12-292-0/+12
| | | | | | | | | | | | | | | | | | | A virtual xattr "glusterfs.geo-rep.trigger-sync" is provided in glusterfs through changelog translator. Geo-rep triggers a explicit data sync on setting this xattr on a file. Changelog captures a DATA entry on file's gfid on setting this virtual xattr on a file. This is supported only for files. It doesn't support directories. Usage: setfattr -n glusterfs.geo-rep.trigger-sync <file-path> Change-Id: Ia689326ac2dcb31035ffbecad2c548eda4eb9245 BUG: 1176934 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/9337 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com>
* glusterd: Move statedump utils into a new file.Krishnan Parthasarathi2014-12-285-233/+272
| | | | | | | | | Change-Id: I1bf26c9d294e95f7b82cfc7a96f9d5575f5e0362 BUG: 1176770 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/9313 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
* glusterd: check_volume_exists should query in-memory representationKrishnan Parthasarathi2014-12-281-19/+2
| | | | | | | | | | | | | | ... instead of consulting the on-disk data directory. There is no reason why the on-disk is more accurate than the in-memory representation. In fact, it is the other way around when a node is reconciling volume/cluster configuration with the rest of the cluster. Change-Id: I786823efdf1d0f6b9e6fcdb72d51e5227c399ce1 BUG: 1176770 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/9292 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
* glusterd: coverity fix for overrun in glusterd_stop_uds_listenerAtin Mukherjee2014-12-281-5/+5
| | | | | | | | | | | | CID: 1260432 Change-Id: I6845bc4c231b53428419a5a2ad0c78ea9da31058 BUG: 1093692 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/9338 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* mgmt/glusterd: Add option to enable lock tracePranith Kumar K2014-12-282-10/+21
| | | | | | | | | | | 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-276-81/+410
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* cluster/afr: Make entry-self-heal in afr-v2 compatible with afr-v1Pranith Kumar K2014-12-261-1/+28
| | | | | | | | | | | | | | | | | | | | | Problem: entry self-heal in 3.6 and above, takes full lock on the directory only for the duration of figuring out the xattrs of the directories where as 3.5 takes locks through out the entry-self-heal. If the cluster is heterogeneous then there is a chance that 3.6 self-heal is triggered and then 3.5 self-heal will also triggered and both the self-heal daemons of 3.5 and 3.6 do self-heal. Fix: In 3.6.x and above get an entry lock on a very long name before entry self-heal begins so that 3.5 entry self-heal will not get locks until 3.6.x entry self-heal completes. Change-Id: I71b6958dfe33056ed0a5a237e64e8506c3b0fccc BUG: 1168189 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/9227 Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.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>
* afr: stop encoding subvolume id in readdir d_offAnand Avati2014-12-263-131/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The purpose of encoding d_off in AFR is to indicate the selected subvolume for the first readdir, and continue all further readdirs of the session on the same subvolume. This is required because, unlike files, dir d_offs are specific to the backend and cannot be re-used on another subvolume. The d_off transformation encodes the subvolume id and prevents such invalid use of d_offs on other servers. However, this approach could be quite wasteful of precious d_off bit-space. Unlike DHT, where server id can change from entry to entry and thus encoding the server id in the transformed d_off is necessary, we could take a slightly relaxed approach in AFR. The approach is to save the subvolume where the last readdir request was sent in the fd_ctx. This consumes constant space (i.e no per-entry cache), and serves the purpose of avoiding d_off "misuse" (i.e using d_off from one server on another). The compromise here is NFS resuming readdir from a non-0 cookie after an extended delay (either anonymous FD has been reclaimed, or server has restarted). In such cases a subvolume is picked freshly. To make this fresh picking more deterministic (i.e, to pick the same subvolume whenever possible, even after reboots), the function afr_hash_child (used by afr_read_subvol_select_by_policy) is modified to skip all dynamic inputs (i.e PID) for the case of directories. Change-Id: I46ad95feaeb21fb811b7e8d772866a646330c9d8 BUG: 1163161 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/9332 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* features/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>
* geo-rep: Sync atime, mtime to slave when SETATTRAravinda VK2014-12-252-3/+15
| | | | | | | | | | | | Existing geo-rep only syncs chown and chmod, with this patch geo-rep also syncs atime and mtime. Change-Id: Iea52d86682873bb4a47eeb0d325f5b9ddf2de2cf Signed-off-by: Aravinda VK <avishwan@redhat.com> BUG: 1176934 Reviewed-on: http://review.gluster.org/9331 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com>
* afr: coverity fixesRavishankar N2014-12-236-19/+21
| | | | | | | | | | | | | Some fixes for the 17th Dec 2014 run. https://scan6.coverity.com:8443/reports.htm#v31028/p10714/g31029 Change-Id: Ia4410ef87a56fffb61803d0a4e62369b058e1cfb BUG: 1176089 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/9314 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>
* cluster/afr : Change in volume heal info commandAnuradha2014-12-2311-265/+498
| | | | | | | | | | | | | | | | gluster volume heal <volname> info command will now also display if the files listed (in the output of the command) are in split-brain or possibly being healed. This patch also fixes build warning that occurs. Change-Id: I1fc92e62137f23b2b9ddf6e05819cee6230741d1 BUG: 1163804 Signed-off-by: Anuradha <atalur@redhat.com> Reviewed-on: http://review.gluster.org/9119 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* glusterd: fix unix domain notify fnKrishnan Parthasarathi2014-12-231-2/+11
| | | | | | | | | | | ... and unlink the 'right' socket file Change-Id: Id12ee8c622914555b7933104e13b43b3b31b5d19 BUG: 1176770 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/9315 Reviewed-by: Kaushal M <kaushal@redhat.com> Tested-by: Kaushal M <kaushal@redhat.com>
* Avoid spurious directory metedata split brainEmmanuel Dreyfus2014-12-221-1/+115
| | | | | | | | | | | | | | | | | | | When directory content is modified, [mc]time is updated. On Linux, the filesystem does it, while at least on NetBSD, the kernel file-system independant code does it. This means that when entries are added while bricks are down, the kernel sends a SETATTR [mc]time which will cause metadata split brain for the directory. In this case, clear the split brain by finding the source with the most recent modification date. BUG: 1129939 Change-Id: Ic0177e0df753a4748624d0b906834ed54593adb9 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9291 Reviewed-by: Ravishankar N <ravishankar@redhat.com> Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* glusterd: Maintain per transaction xaction_peers list in syncop & mgmt_v3Atin Mukherjee2014-12-226-139/+256
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In current implementation xaction_peers list is maintained in a global variable (glustrd_priv_t) for syncop/mgmt_v3. This means consistency and atomicity of peerinfo list across transactions is not guranteed when multiple syncop/mgmt_v3 transaction are going through. We had got into a problem in mgmt_v3-locks.t which was failing spuriously, the reason for that was two volume set operations (in two different volume) was going through simultaneouly and both of these transaction were manipulating the same xaction_peers structure which lead to a corrupted list. Because of which in some cases unlock request to peer was never triggered and we end up with having stale locks. Solution is to maintain a per transaction local xaction_peers list for every syncop. Please note I've identified this problem in op-sm area as well and a separate patch will be attempted to fix it. Finally thanks to Krishnan Parthasarathi and Kaushal M for your constant help to get to the root cause. Change-Id: Ib1eaac9e5c8fc319f4e7f8d2ad965bc1357a7c63 BUG: 1173414 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/9269 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
* gfapi: always close the fd in glfs_h_creat()Niels de Vos2014-12-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | When running stress and performance tests against nfs-ganesha, the number of open file descriptors increases continously. If the tests run long enough, the brick processes will eventually run out of file descriptors. This seems to be caused by glfs_h_creat() which allocates a 'struct glfs_fd', but does not release it. A normal glfs_creat() returns the file descriptor to the application, whereas glfs_h_creat() returns a handle (struct glfs_object). The file descriptor associated with the handle can not be release by glfapi-applications. This fd-leak can be prevented by destroying the 'struct glfs_fd' before returning the 'struct gfls_object' to the gfapi-application. Change-Id: I32465077a35cd0449a8e584c53899b32f022e5af BUG: 1176242 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9318 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* glusterd: Returning success from mgmt_v3 handler functionsAvra Sengupta2014-12-191-8/+42
| | | | | | | | | | | | | | | | The mgmt_v3 handler functions already send the ret code as part of the *send_resp calls, and further propagating the ret code to the calling functions will lead to double deletion of the req object. Hence returning success from the mgmt_v3 handler functions. Change-Id: I1090e49c54a786daae5fd97b5c1fbcb5d819acba BUG: 1138577 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/8620 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* glusterd: Copy brick port no. if brick is runningAvra Sengupta2014-12-191-5/+18
| | | | | | | | | | | | Instead of relying on brickinfo->status, check if the brick process is running before copying the brick port number. Change-Id: I246465fa4cf4911da63a1c26bbb51cc4ed4630ac BUG: 1175700 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/9297 Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* mgmt/glusterd: do not restart nfs server when snapshot is deactivatedRaghavendra Bhat2014-12-181-0/+3
| | | | | | | | | Change-Id: Ie5eaa2beb4446640b22873f91e17da90d1cd8fad BUG: 1174625 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/9280 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com>