summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* posix: remove duplicate dirfd calls in posix_opendirAtin Mukherjee2014-11-301-1/+1
| | | | | | | | | BUG: 1168910 Change-Id: I285d352d20374bb3edee2db42d062d4724198425 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/9186 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Prevent metadata corruption in the race conditions betweenEdward Shishkin2014-11-301-9/+23
| | | | | | | | | | | | | | | | | | | | FOP->open() and FOP->link(). Problem: crypt_open() modifies @local->format, which is used by crypt_link() to store the updated metadata string on disk. This results in metadata corruption. Fixup: Don't modify @local->format by FOP->open(). Instead modify a local copy, allocated in the low-level meta-data handler open_format_v1(). Change-Id: I046bb39ddefc33afe59c8d3b1a2fa798298f8499 BUG: 1157839 Signed-off-by: Edward Shishkin <edward@redhat.com> Reviewed-on: http://review.gluster.org/8982 Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org> Tested-by: Emmanuel Dreyfus <manu@netbsd.org> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* posix: Fix buffer overrun in _handle_list_xattr()Emmanuel Dreyfus2014-11-281-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | In _handle_list_xattr() we test remaining_size > 0 to check that we do not overrun the buffer, but since that variable was unsigned (size_t), the condition would let us go beyond end of buffer if remaining_size became negative. This could happen if attribute list grew between the first sys_llistxattr() call that gets the size and the second sys_llistxattr() call that get the data. We fix the problem by making remaining_size signed (ssize_t). This also matches sys_llistxattr() return type. While there, we use the size returned by the second sys_llistxattr() call to parse the buffser, as it may also be smaller than the size obtained from first call, if attribute list shrank. This fixes a spurious crash in tests/basic/afr/resolve.t BUG: 1129939 Change-Id: Ifc5884dd0f39a50bf88aa51fefca8e2fa22ea913 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9204 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* glupy: build fix if python and glusterfs prefix differEmmanuel Dreyfus2014-11-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | If python is installed in ${pythonprefix} and glusterfs in ${glusterfsprefix}, we have the following values: ${PYTHON}-config --prefix => ${pythonprefix} $libdir => ${glusterfsprefix}/lib Using LDFLAGS="-L`${PYTHON}-config --prefix`/$libdir" we lookf for python libraries in ${pythonprefix}/${glusterfsprefix}/lib while we should be looking for ${pythonprefix}/lib Replacing $libdir by lib breaks bug 1159248, so let us look in both ${pythonprefix}/lib and ${pythonprefix}/$libdir BUG: 1129939 Change-Id: I2fef1b795235d1543a0e5ac619c6c2d59127fb66 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9137 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@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>
* tests: entry self-heal test casesPranith Kumar K2014-11-271-0/+344
| | | | | | | | | Change-Id: I9390bc9274eb2485af541c4044bac12e48c44064 BUG: 1128721 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8539 Reviewed-by: Ravishankar N <ravishankar@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* Regression test portability: batch of bugs (volume 2)Emmanuel Dreyfus2014-11-2615-18/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix various regression test portability in tests/bugs. bug-861542.t - Avoid syntax specific to GNU sed. bug-860663.t - Command argument length is system dependent, and specifying 1000 file path may overflow it. Use a C program to do the job in a portable and efficient way. - Add a test that we created the specified amount of files. bug-858242.c, bug-808400-fcntl.c, bug-808400-flock.c - fstat64() is Linux-specific. Define it as fstat for other systems. bug-823081.t - Use portable tail -n instead of tail --lines In many tests: - Do not assume python interpreter name. Use $PYTHON as defined in env.rc by configure. utils/libcxattr.py - If python version is 2.6 or higher, use a portable mechanism to recover errno. The original version is retained for python version 2.5 and earlier but it only works on Linux. BUG: 1129939 Change-Id: If2fea1ffec5cc6ab2de426fb200e884450afe61b Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9097 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* core: fix remaining *printf formation warnings on 32-bitKaleb S. KEITHLEY2014-11-266-19/+22
| | | | | | | | | | | | | | | | | | This fixes a few lingering size_t problems. Of particular note are some uses of off_t for size params in function calls. There is no correct, _portable_ way to correctly print an off_t. The best you can do is use a scratch int64_t/PRId64 or uint64_t/PRIu64. Change-Id: I86f3cf4678c7dbe5cad156ae8d540a66545f000d BUG: 1110916 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/8105 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* doc: Avoid duplicate rdma notes.Humble Chirammal2014-11-262-9/+9
| | | | | | | | Change-Id: I5ede0ffad3870d8d86cb5d551ce188c649b04b44 Signed-off-by: Humble Chirammal <hchiramm@redhat.com> Reviewed-on: http://review.gluster.org/8826 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* extras: geo-rep: Customize the generate gfid script to dirs listAravinda VK2014-11-261-5/+22
| | | | | | | | | | | generate-gfid-file.sh now accepts dirs list file and generate gfids only for those dirs list. Change-Id: Ia78a0a744dc8a079db56c38578cc6fcac2a6fa90 Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/8540 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* dict: Remove the redundant hash calculation when the hash size is 1Poornima Gurusiddaiah2014-11-261-5/+23
| | | | | | | | | | | | | Currently the dict is created with hash size 1, i.e. there is only one hash bucket and the calculation of hash decomes redundant. Change-Id: Id70aea0d798902494ebb6d82955d97d591bc73d2 BUG: 789278 Signed-off-by: Poornima Gurusiddaiah <pgurusid@redhat.com> Reviewed-on: http://review.gluster.org/8211 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* gluster/uss: Handle ESTALE in snapview client when NFS server restartedvmallika2014-11-255-19/+85
| | | | | | | | | | | | | | | 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>
* dict: Write dict_foreach_* in form of dict_foreach_matchPranith Kumar K2014-11-251-53/+18
| | | | | | | | | | Change-Id: Iaa3454f7f3b6516660b1976bea63e39ea7795f8f BUG: 1164051 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/9121 Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* core: fix Ubuntu code audit (cppcheck) resultsKaleb S. KEITHLEY2014-11-2512-51/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See also http://review.gluster.org/#/c/7693/, BZ 1091677 AFAICT these are false positives: [geo-replication/src/gsyncd.c:100]: (error) Memory leak: str [geo-replication/src/gsyncd.c:403]: (error) Memory leak: argv [xlators/nfs/server/src/nlm4.c:1201]: (error) Possible null pointer dereference: fde [xlators/cluster/afr/src/afr-self-heal-common.c:138]: (error) Possible null pointer dereference: __ptr [xlators/cluster/afr/src/afr-self-heal-common.c:140]: (error) Possible null pointer dereference: __ptr [xlators/cluster/afr/src/afr-self-heal-common.c:331]: (error) Possible null pointer dereference: __ptr Test program: [extras/test/test-ffop.c:27]: (error) Buffer overrun possible for long command line arguments. [tests/basic/fops-sanity.c:55]: (error) Buffer overrun possible for long command line arguments. the remainder are fixed with this change-set: [cli/src/cli-rpc-ops.c:8883]: (error) Possible null pointer dereference: local [cli/src/cli-rpc-ops.c:8886]: (error) Possible null pointer dereference: local [contrib/uuid/gen_uuid.c:369]: (warning) %ld in format string (no. 2) requires 'long *' but the argument type is 'unsigned long *'. [contrib/uuid/gen_uuid.c:369]: (warning) %ld in format string (no. 3) requires 'long *' but the argument type is 'unsigned long *'. [xlators/cluster/dht/src/dht-rebalance.c:1734]: (error) Possible null pointer dereference: ctx [xlators/cluster/stripe/src/stripe.c:4940]: (error) Possible null pointer dereference: local [xlators/mgmt/glusterd/src/glusterd-geo-rep.c:1718]: (error) Possible null pointer dereference: command [xlators/mgmt/glusterd/src/glusterd-replace-brick.c:942]: (error) Resource leak: file [xlators/mgmt/glusterd/src/glusterd-replace-brick.c:1026]: (error) Resource leak: file [xlators/mgmt/glusterd/src/glusterd-sm.c:249]: (error) Possible null pointer dereference: new_ev_ctx [xlators/mgmt/glusterd/src/glusterd-snapshot.c:6917]: (error) Possible null pointer dereference: volinfo [xlators/mgmt/glusterd/src/glusterd-utils.c:4517]: (error) Possible null pointer dereference: this [xlators/mgmt/glusterd/src/glusterd-utils.c:6662]: (error) Possible null pointer dereference: this [xlators/mgmt/glusterd/src/glusterd-utils.c:7708]: (error) Possible null pointer dereference: this [xlators/mount/fuse/src/fuse-bridge.c:4687]: (error) Uninitialized variable: finh [xlators/mount/fuse/src/fuse-bridge.c:3080]: (error) Possible null pointer dereference: state [xlators/nfs/server/src/nfs-common.c:89]: (error) Dangerous usage of 'volname' (strncpy doesn't always null-terminate it). [xlators/performance/quick-read/src/quick-read.c:586]: (error) Possible null pointer dereference: iobuf Rerunning cppcheck after fixing the above: As before, test program: [extras/test/test-ffop.c:27]: (error) Buffer overrun possible for long command line arguments. [tests/basic/fops-sanity.c:55]: (error) Buffer overrun possible for long command line arguments. As before, false positive: [geo-replication/src/gsyncd.c:100]: (error) Memory leak: str [geo-replication/src/gsyncd.c:403]: (error) Memory leak: argv [xlators/nfs/server/src/nlm4.c:1201]: (error) Possible null pointer dereference: fde [xlators/cluster/afr/src/afr-self-heal-common.c:138]: (error) Possible null pointer dereference: __ptr [xlators/cluster/afr/src/afr-self-heal-common.c:140]: (error) Possible null pointer dereference: __ptr [xlators/cluster/afr/src/afr-self-heal-common.c:331]: (error) Possible null pointer dereference: __ptr False positive after fix: [xlators/performance/quick-read/src/quick-read.c:584]: (error) Possible null pointer dereference: iobuf Change-Id: I20e0e3ac1d600b2f2120b8d8536cd6d9e17023e8 BUG: 1109180 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/8064 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* cli: .cmd_log_history should not be hiddenAtin Mukherjee2014-11-242-5/+6
| | | | | | | | | Change-Id: I4513a2c260530855e09be64083e9344108c7a6c0 BUG: 1165996 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/9150 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
* tests: mgmt_v3_locks.t fixAtin Mukherjee2014-11-241-1/+1
| | | | | | | | | | | | this patch fixes a small issue introduced by http://review.gluster.org/#/c/9114/ Change-Id: I42a91544fad2b5f8af70670e4c4cadcac094dd05 BUG: 1163543 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/9171 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: 长财 余 <einstcrazy@gmail.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
* Regression tests portability: Do not 'cd' into volumeXavier Hernandez2014-11-242-67/+65
| | | | | | | | | | | | | | | | | Changing current directory to the root of the volume to execute tests from there keeps an open file descriptor to it that could interfere with some tests. I've removed all 'cd' and used abosulte paths on all tests. Change-Id: Ic54afb7d7974e9e80818201bcd99ee2b01d00442 BUG: 1129939 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/9151 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org> Tested-by: Emmanuel Dreyfus <manu@netbsd.org>
* Replace copied (from rsync) checksum code by adler32() from zlibNiels de Vos2014-11-213-35/+9
| | | | | | | | | | | | | | | | | | | | The weak checksum code that is included in libglusterfs has initialy been copied from the rsync sources. Instead of maintaining a copy of a function, we should use a function from a shared library. The algorithm seems to be Adler-32, zlib provides an implementation. The strong checksum function has already been replaced by MD5 from OpenSSL. It is time to also remove the comments about the origin of the implementation, because it is not correct anymore. Change-Id: I70c16ae1d1c36b458a035e4adb3e51a20afcf652 BUG: 1149943 Reported-by: Wade Mealing <wmealing@redhat.com> Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9035 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* rdma:Removing RDMA tech preview cli message.Mohammed Rafi KC2014-11-211-13/+0
| | | | | | | | | | | | | | | | | Creation of rdma and tcp,rdma volume will display a warning message since it was in tech preview. This patch will remove the warning message during the volume creation. Change-Id: I54f46097073bcb5a757ab047f540cd9b92553897 BUG: 1164079 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/9141 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: jiffin tony Thottan <jthottan@redhat.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* mount:Handle -o transport option in mount.glusterfsMohammed Rafi KC2014-11-211-13/+5
| | | | | | | | | | | | | | | | | | | In current scenario ,when tcp transport type(default) specified for mounting,glusterfs mount script won't append '.tcp' to volume name.But to accommodate the change in http://review.gluster.org/#/c/9146/, we need to append ".tcp" with volfile-id if '-o transport=tcp' is given. Change-Id: I506edeb339de062087f820f10e17c7d67b8b63fe BUG: 1164079 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/9147 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: jiffin tony Thottan <jthottan@redhat.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* glusterd: Add hostname/ip-address along with host's UUID in glusterd log messageGauravKumarGarg2014-11-201-2/+3
| | | | | | | | | | | | | | | | | Previously when host disconnected from cluster then glusterd logs identifies host using host's UUID. Now with this fix, UUID along with host's ip will be present in glusterd log message when one of the peer disconnected from cluster. So it will enhancement better readability of user from log file. Change-Id: I3b7eaf1b1a8963ef2096e67a78cf69f67d5d5166 BUG: 1101382 Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/9136 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
* pkg-config: make the version in gluster-api.pc backwards compatibleNiels de Vos2014-11-201-1/+10
| | | | | | | | | | | | | | | | | | | | Once we released gluster-api.pc with version=4. Since then we undid the library versioning and replaced it with symbol-versioning. The current libgfapi.so has version 0, but the symbols have the version from the main package at the time they were added. Because other packages (like samba) use the pkg-config version, we can not drop it, or decrease the version easily. The simplest solution is to keep the version=4 and add sub-digits for the actual package/symbol versions. In future, the version in gluster-api.pc will be like 4.3.x.y. Change-Id: If359c8de5b847a7e818199a7246636113837da2d BUG: 1166232 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9154 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* core: use gf_time_fmt() instead of localtime()+strftime()Kaleb S. KEITHLEY2014-11-207-78/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | gf_time_fmt() has existed since 3.3; it provides consistent timestamps (i.e. UTC times) throughout the implementation. (BTW, the other name for UTC is GMT.) N.B. many (all?) commercial storage solutions use UTC time for logging. This makes for easier debugging across geographically distributed systems. Also adding a "%s" fmt for portably printing time as simple numeric value on systems regardless of whether 32-bit or 64-bit time_t. Plus a minor tweak to return a ptr to the dest-string to allow gf_time_fmt() to be passed as a param in a *printf(). Someday we should pick the "one true" timestamp format and revise all calls to gf_time_fmt() to use it instead of the five or six different formats. Change-Id: I78202ae14b7246fa424efeea56bf2463e14abfb0 BUG: 1109917 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/8085 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* tests: spurious failure fix for bug-1164613.tvmallika2014-11-201-5/+8
| | | | | | | | | | | | | Snapshot bricks are started asynchronously. It might take sometime before accessing the file. Change-Id: I62633974eca21f86632f7005ce6fd5c856b8be90 BUG: 1163543 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/9142 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com>
* rdma: Client volfile name change for supporting rdmaAnoop C S2014-11-192-4/+22
| | | | | | | | | | | | | | | | | | | For rdma only volumes, daemons like snapd, glustershd etc make use of tcp transport for their operations. This patch will introduce the support of rdma by default for those daemons in rdma only volumes. In order to accomodate this change we rename the tcp client volfile labels from <volname>-fuse.vol to <volname>.tcp-fuse.vol Change-Id: Id9727b97d00e62a4a1556b9c0c56653d45c8fe1d BUG: 1164079 Signed-off-by: Anoop C S <achiraya@redhat.com> Reviewed-on: http://review.gluster.org/9146 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
* md-cache: check mtime_nsec and ctime_nsec fields for changes tooNiels de Vos2014-11-191-2/+6
| | | | | | | | | | | | | | | | | When md-cache checks for an updated mtime/ctime in order to see if it should request a cache invalidation, it only looks at the whole-second "mtime" and "ctime" fields. If a file was modified a fraction of a second after the time of the cached data, md-cache won't notice the change. BUG: 1164506 Change-Id: Ieb7baa46f84489d2d7ea8d60a7fb2595564eb955 Original-author: Philip Spencer <pspencer@fields.utoronto.ca> Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9131 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* md-cache: cache the iatt when readv() was successfulNiels de Vos2014-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | When md-cache is handling a readv callback, its logic is to skip checking the file's iatt (to see if it has changed since the time of the last cache) if "op_ret != 0". This is a mistake, and the intent was to skip only on error; for other fops, op_ret is 0 on success and nonzero on error, and md-cache has the same code for them. For readv, though, op_ret is the number of bytes read, so it will normally be positive except on EOF. BUG: 1164503 Change-Id: Ifc0f2084b41b6f8d075a9260dc7cf69e97535eed Original-author: Philip Spencer <pspencer@fields.utoronto.ca> Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9129 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Regression tests portability: basic/ec/self-heal.tEmmanuel Dreyfus2014-11-191-1/+1
| | | | | | | | | | | | When checking for bricks availability, use ls -l produces a more reliable result than just ls. BUG: 1129939 Change-Id: Ided548a8f4154714d2c33ec538d0623d7c328952 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9133 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
* tests: spurious failure fix for quota-anon-fd-nfs.tAtin Mukherjee2014-11-192-1/+53
| | | | | | | | | Change-Id: I4f7ee68c514d8d322e25cf74167f288a8b6f8164 BUG: 1163543 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/9108 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* rdma :mount fails for nfs protocol in rdma volumesJiffin Tony Thottan2014-11-197-25/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we mount rdma only volume or tcp,rdma volume using newly peer probed IP's(nfs-server on new nodes) through nfs protocol, mount fails for rdma only volume and mount happens with help of tcp protocol in the case of tcp,rdma volumes. That is for newly added servers will always get transport type as "socket". This is due to nfs_transport_type is exported correctly and imported wrongly. This can be verified by the following , * Create a rdma only volume or tcp,rdma volume * Add a new server into the trusted pool. * Checkout the client transport type specified nfs-server volgraph.It will be always tcp(socket type) instead of rdma. * And also for rdma only volume in the nfs log, we can see 'connection refused' message for every reconnect between nfs server and glusterfsd. BUG: 1157381 Change-Id: I6bd4979e31adfc72af92c1da06a332557b6289e2 Author: Jiffin Tony Thottan <jthottan@redhat.com> Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com> Reviewed-on: http://review.gluster.org/8975 Reviewed-by: Meghana M <mmadhusu@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Niels de Vos <ndevos@redhat.com>
* tests: spurious failure fix in mgmt_v3_locks.tAtin Mukherjee2014-11-181-5/+4
| | | | | | | | | | Change-Id: I7c4599648b5d47d93a447e58c063fab21e8f9ef7 BUG: 1163543 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/9114 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com> Tested-by: Kaushal M <kaushal@redhat.com>
* rdma:client process will hang if server is started to sendMohammed Rafi KC2014-11-181-0/+21
| | | | | | | | | | | | | | | | | | | | | | the request before completing connection establishment in rdma, client and server will interchange their available buffers during the handshake to post incoming messages. Initially the available buffer is set to one, for the first message during handshake,when first message is received, quota for the buffer will set to proper value. So before receiving the message if server started to send the message, then the reserverd buffer for handshake will be utilised, then the handshake will fail because of lack of buffers. So we should block sending messages by server before proper connection establishment. Change-Id: I68ef44998f5df805265d3f42a5df7c31cb57f136 BUG: 1158746 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/9003 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* rdma: Wrong volfile fetch on fuse mounting tcp,rdma volume via rdmaAnoop C S2014-11-184-82/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of now for both tcp only volumes and rdma only volumes, volfile names are in the format <volname>-fuse.vol. This patch will change the client volfile namings as shown below. * TCP mounts always use <volname>-fuse.vol * RDMA mounts always use <volname>.rdma-fuse.vol Following the above naming convention, for tcp,rdma volumes both volfiles will be present under /var/lib/glusterd/vols/<volname>/ such that rdma only volume can be mounted as mount -t glusterfs -o transport=rdma <server/ip>:/<volname> <mount-point> OR mount -t glusterfs <server/ip>:/<volname>.rdma <mount-point> The above command format can also be used to fuse mount a tcp,rdma volume via rdma transport. When we try to fuse mount a tcp,rdma volume with transport-type as rdma it silently mounts via tcp. This change will also make sure that it fetches the correct volfile based on the transport-type specified from client side. BUG: 1131502 Change-Id: I34da4b01ac813b69494a43188f51145457412923 Signed-off-by: Anoop C S <achiraya@redhat.com> Reviewed-on: http://review.gluster.org/8498 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* rdma: client connection establishment takes more timeMohammed Rafi KC2014-11-187-43/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For rdma type only volume client connection establishment with server takes more than three seconds. Because for tcp,rdma type volume, will have 2 ports one for tcp and one for rdma, tcp port is stored with brickname and rdma port is stored as "brickname.rdma" during pamap_sighin. During the handshake when trying to get the brick port for rdma clients, since we are not aware of server transport type, we will append '.rdma' with brick name. So for tcp,rdma volume there will be an entry with '.rdma', but it will fail for rdma type only volume. So we will try again, this time without appending '.rdma' using a flag variable need_different_port, and it will succeed, but the reconnection happens only after 3 seconds. In this patch for rdma only type volume we will append '.rdma' during the pmap_signin. So during the handshake we will get the correct port for first try itself. Since we don't need to retry , we can remove the need_different_port flag variable. Change-Id: Ie8e3a7f532d4104829dbe995e99b35e95571466c BUG: 1153569 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/8934 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* rdma:rdma fuse mount hangs for tcp,rdma volumes if brick is down.Mohammed Rafi KC2014-11-175-13/+18
| | | | | | | | | | | | | | | | | | | | | | | | When we try to mount a tcp,rdma volume as rdma transport using FUSE protocol, then mount will hang if the brick is down. When we kill a process, signal will be received in glusterfsd process and it will call pmap_signout with port listening on tcp only. In case of the tcp,rdma there will be two ports, and port which is listening for rdma will not called for sign out. So the mount process will try to connect to a port which is not open and it will keep trying to connect. This patch will call pmap_signout for rdma port also, So when mount tries to get the brick port,it will fail. Change-Id: I23676f65f96eb90b69b76478f7a21412a6aba70f BUG: 1143886 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/8762 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@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>
* USS : Kill snapd during glusterd restart if USS is disabledSachin Pandit2014-11-171-5/+25
| | | | | | | | | | | | | | | | | | | | | | | Problem : When glusterd is down on one of the nodes and during that time if USS is disabled then snapd will still be running in the node where glusterd was down. Solution : during restart of glusterd check if USS is disabled, if so then issue a kill for snapd. NOTE : The test case which I wrote in my previous patchset is facing some spurious failures, hence I thought of removing that test case. I'll add the test case once the issue is resolved. Change-Id: I2870ebb4b257d863cdfc319e8485b19e932576e9 BUG: 1161015 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/9062 Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Avra Sengupta <asengupt@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>
* gluster/uss: Don't send failure when accessing snap with namevmallika2014-11-172-14/+38
| | | | | | | | | | | | | | | | | | 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>
* cluster/dht: Fix subvol check, to correctly determine cached file renameShyam2014-11-172-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | The check to treat rename as a critical failure ignored when the cached file is being renamed to new name, as the new name falls on the same subvol as the cached file. This is in addition to when the target of the rename does not exist. The current change is simpler, as the rename logic, renames the cached file in case the target exists and falls on the same subvol as source name, OR the target does not exist and the hash of target falls on the same subvol as source cached. These conditions mean we are renaming the source, other conditions mean we are renaming the source linkto file which we do not want to treat as a critical failure (and we also instruct marker that it is an internal FOP and to not account for the same). Change-Id: I4414e61a0d2b28a429fa747e545ef953e48cfb5b BUG: 1161156 Signed-off-by: Shyam <srangana@redhat.com> Reviewed-on: http://review.gluster.org/9063 Reviewed-by: N Balachandran <nbalacha@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: susant palai <spalai@redhat.com> Reviewed-by: venkatesh somyajulu <vsomyaju@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* client: writev,fsync to use correct rsp structureRudra Siva2014-11-161-2/+2
| | | | | | | | | | | | | Presently writev_cbk and fsync_cbk pass truncate_rsp for decoding, this should not create any problems as they are structurally the same. Should they diverge in the future this could show up as a bug. Change-Id: Id7da7b6a20f468ca943ceb7926de64b7692f7ec8 BUG: 1164559 Signed-off-by: Rudra Siva <rudrasiva11@gmail.com> Reviewed-on: http://review.gluster.org/9134 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* client: pass xflags for unlinkJeff Darcy2014-11-151-0/+1
| | | | | | | | | | | | | | | | | Nobody seems to use these currently, but I tried to for some debugging, and that led to a few head-scratches before I figured out that it wasn't being passed across the server/client boundary. Might as well fix it before somebody tries to use it for real and has to go through the same exercise. Change-Id: Ieddfac106103db02fdf488c86f3f979d29a6ab83 BUG: 1158614 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/8287 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* mem_acct : Check return value of xlator_mem_acct_init().Humble Chirammal2014-11-154-6/+19
| | | | | | | | | | | | | | some code does not check xlator_mem_acct_init() return, thus fails to capture wrong memory accounting initialization. This patch fix the same. Change-Id: I01eab19d6cef472afd850b0f964132c01523492a BUG: 1123768 Signed-off-by: Humble Chirammal <hchiramm@redhat.com> Reviewed-on: http://review.gluster.org/7728 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* ec: Avoid self-heal on directories on (f)stat callsXavier Hernandez2014-11-151-1/+2
| | | | | | | | | | | | | | | | | | | To avoid inconsistent directory listings, a full self-heal cannot happen on a directory until all its contents have been healed. This is controlled by a manual command using getfattr recursively and in post-order. While navigating the directories, sometimes an (f)stat fop can be sent. This fop caused a full self-heal of the directory. This patch makes that (f)stat only initiates a partial self-heal. Change-Id: I0a92bda8f4f9e43c1acbceab2d7926944a8a4d9a BUG: 1163760 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/9117 Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* doc: update rebalance doc, add SSL/TLS docJeff Darcy2014-11-152-0/+134
| | | | | | | | | Change-Id: I5d21aabaa6bfa6de40459c9a1969832a0a5d75e1 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/8961 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* gNFS : make it possible to mount a subdir that actually is a symlinkjiffin2014-11-144-1/+398
| | | | | | | | | | | | | | | | | We are using the function to export all sub-directories in a gluster volume via nfs. For real directories it works fine but if we have a symbolic link which points to the directory, it is not possible to mount that directory via nfs and the nameof the link. Kernel nfs resolves symlink handle to directoryhandle , similar gluster nfs should resolve the symbolic link handle into directory handle. Change-Id: I8bd07534ba9474f0b863f2335b2fd222ab625dba BUG: 1157223 Signed-off-by: jiffin tony thottan <jthottan@redhat.com> Reviewed-on: http://review.gluster.org/9052 Reviewed-by: soumya k <skoduri@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* uss/snapd: Handle readlink fops on snap view serverAvra Sengupta2014-11-142-0/+39
| | | | | | | | | | | | | 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>
* rdma: glusterd crash if rdma_disconnect is called as soon as connect a request.Mohammed Rafi KC2014-11-141-9/+17
| | | | | | | | | | | | | | | | | | we are initializing connection in server side immediately after rdma_accept is called. But we are delaying adding the transport to listener list until getting RDMA_CM_EVENT_ESTABLISHED event. Before getting this event if disconnect is called glusterd will try to remove the transport from list which is not added. So if the list is empty it causes a glusterd crash . In this patch we will call the function to initialize the connection as soon as rdma_accept is called. Change-Id: I019480297a85349ede3101ee9c7c1596dc5c73e2 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> BUG: 1164079 Reviewed-on: http://review.gluster.org/8925 Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
* mgmt/glusterd: Validate the options of ussvmallika2014-11-143-7/+23
| | | | | | | | | | | Change-Id: Id13dc4cd3f5246446a9dfeabc9caa52f91477524 BUG: 1111554 Signed-off-by: Varun Shastry <vshastry@redhat.com> Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/8133 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* posix: Changed order of chown and chmodVenkatesh Somyajulu2014-11-142-7/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Rebalance process runs in the root mode. If a normal user create a file and if it requires migration then because the migrated file is created by root, its owner and mode should be changed to the source normal user and permission should be changed the previous mode. If the suid bit is also set, then at the destination suid bit should also be set. Two operations are performed in the given order: 1. chmod 2. chown But chown resets the suid bit. So changed the order of these two operations so that first chown will be performed and then chmod will be performd so that suid bit will be preserved. Change-Id: Ib63b5cf528f8336b69bf090ad43bb02eec1d1602 BUG: 1086228 Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com> Reviewed-on: http://review.gluster.org/7435 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* cli : Maintain separate cli log file per cli instance for cluster regression ↵Atin Mukherjee2014-11-141-2/+11
| | | | | | | | | | | | | tests Change-Id: I7f49f4999d997b99c103fd67d13f972937e3aa92 BUG: 1162987 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/9100 Reviewed-by: Kaushal M <kaushal@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>