7534 Commits

Author SHA1 Message Date
Pranith Kumar K
f30af2735c cluster/afr: serialize inode locks
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>
2015-01-04 19:51:43 -08:00
Atin Mukherjee
2ddd3b2f2b tests: return non-zero value instead of exit in functions within the test run
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>
2015-01-02 07:21:14 -08:00
Krutika Dhananjay
7e27cb2352 features/uss: Perform NULL check on @name in svc_getxattr
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>
2015-01-02 05:10:12 -08:00
Emmanuel Dreyfus
4c3a6bc457 Do not use umount -l on non Linux systems
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>
2015-01-02 01:42:12 -08:00
Anuradha
a96375c180 afr: Fixes to commit 85427a23c238499137cbfaafdb7b6ad27f67506a
* 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>
2015-01-01 21:55:04 -08:00
Raghavendra Talur
c826397586 build: Remove files completely in make uninstall.
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>
2015-01-01 03:10:29 -08:00
Krishnan Parthasarathi
59a195ba9c doc: added did-you-know.md to document the less-known
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>
2014-12-31 02:37:12 -08:00
Kotresh HR
0250eb0698 test: Make gfid-access.py more generic.
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>
2014-12-31 01:20:37 -08:00
Aravinda VK
c399cec72b geo-rep: Error handling in tar+ssh mode
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>
2014-12-29 09:11:19 -08:00
Kotresh HR
5e7e12694e feature/changelog: Virtual xattr to trigger explicit sync in geo-rep.
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>
2014-12-29 09:08:05 -08:00
Krishnan Parthasarathi
41e0e325aa glusterd: Move statedump utils into a new file.
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>
2014-12-28 22:59:36 -08:00
Krishnan Parthasarathi
f7a8bd08c8 glusterd: check_volume_exists should query in-memory representation
... 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>
2014-12-28 22:59:15 -08:00
Atin Mukherjee
94dacaa4e9 glusterd: coverity fix for overrun in glusterd_stop_uds_listener
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>
2014-12-28 21:25:28 -08:00
Pranith Kumar K
86433c25b6 mgmt/glusterd: Add option to enable lock trace
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>
2014-12-28 21:18:42 -08:00
vmallika
b6ea761969 quota: For a rename operation, do quota_check_limit only till the
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>
2014-12-27 05:52:07 -08:00
Pranith Kumar K
2947752836 cluster/afr: Make entry-self-heal in afr-v2 compatible with afr-v1
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>
2014-12-26 23:20:54 -08:00
Pranith Kumar K
02b2172d9b features/locks: Add lk-owner checks in entrylk
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>
2014-12-26 23:20:30 -08:00
Anand Avati
7926fe6f7d afr: stop encoding subvolume id in readdir d_off
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>
2014-12-26 06:21:44 -08:00
Vijay Bellur
79a5b2b991 features/marker: log message clean up
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>
2014-12-25 23:32:11 -08:00
Aravinda VK
92cc5d4f64 geo-rep: Sync atime, mtime to slave when SETATTR
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>
2014-12-25 09:48:57 -08:00
Ravishankar N
0299f7f0f7 afr: coverity fixes
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>
2014-12-23 07:22:38 -08:00
Anuradha
85427a23c2 cluster/afr : Change in volume heal info command
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>
2014-12-23 07:09:23 -08:00
Krishnan Parthasarathi
f3df93783d glusterd: fix unix domain notify fn
... 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>
2014-12-23 04:22:22 -08:00
Emmanuel Dreyfus
9a6ea92df1 Avoid spurious directory metedata split brain
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>
2014-12-22 23:29:54 -08:00
Atin Mukherjee
da9deb54df glusterd: Maintain per transaction xaction_peers list in syncop & mgmt_v3
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>
2014-12-22 20:14:14 -08:00
Niels de Vos
0e78a12381 gfapi: always close the fd in glfs_h_creat()
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>
2014-12-20 02:20:56 -08:00
Avra Sengupta
72c8b09640 glusterd: Returning success from mgmt_v3 handler functions
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>
2014-12-19 22:05:47 -08:00
Avra Sengupta
81301d3b00 glusterd: Copy brick port no. if brick is running
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>
2014-12-19 01:59:14 -08:00
Raghavendra Bhat
8484a88364 mgmt/glusterd: do not restart nfs server when snapshot is deactivated
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>
2014-12-18 21:45:32 -08:00
Humble Devassy Chirammal
bb1517ed54 MAINTAINERS: Adding new sub maintainers.
http://supercolony.gluster.org/pipermail/gluster-devel/2014-December/043177.html


Change-Id: Iec587f383cf8da9832932194e2518a6bd99c6380
Signed-off-by: Humble Devassy Chirammal <hchiramm@redhat.com>
Reviewed-on: http://review.gluster.org/9266
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-12-18 00:01:21 -08:00
Raghavendra Bhat
cca09a2a34 performance/readdir-ahead: indicate EOF for readdirp
posix xlator sends op_errno as ENOENT and op_ret as 0, to indicate readdir has
been completed. readdir-ahead should send that op_errno that it has saved in the
fd context, when it serves the readdir requests. Otherwise some xlators sitting
above performance xlators such as snapview-client, which checks for end of
readdir operation by checking op_ret to 0 and op_errno to ENOENT will not be
able to identify end of readdir.

Change-Id: Ib0835136c61cb1e0d7df933226c479c7db703a71
BUG: 1174783
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/9283
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-12-17 18:50:16 -08:00
Xavier Hernandez
531e0a70ff ec: Fix more mutex related coverity scan issues
This patch solves CID 1257622.

Change-Id: I95680c7de49cd84011d2ad38f02e5fad82e15c90
BUG: 1170254
Signed-off-by: Xavier Hernandez <xhernandez@datalab.es>
Reviewed-on: http://review.gluster.org/9263
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
2014-12-17 09:14:51 -08:00
Emmanuel Dreyfus
3abee447da Regression test portability: ec.t
This test unmount/remount the filesystem to invalidate cache,
but this leads to timing problems on NetBSD. We can work them
around without sleeping by remounting on another mount point.

BUG: 1129939
Change-Id: I10b3183e5e715053de162a6980af188710b607bb
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/9285
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
2014-12-17 09:14:07 -08:00
Emmanuel Dreyfus
e398f99d9a telldir()/seekdir() portability fixes
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>
2014-12-17 03:48:22 -08:00
vmallika
466a6f37eb uss/gluster: In SVS, check for entry-point in dict only if inode_ctx is
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>
2014-12-16 05:33:44 -08:00
Raghavendra Bhat
15edbff0a6 gfapi: use different name for GETSPEC callback than the one used by glusterfsd
Change-Id: Ibd5be1e1080f9da4ac1fb9112538b3320ef2ff28
BUG: 1174205
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/9277
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
2014-12-15 07:21:38 -08:00
Niels de Vos
358576530c build: prevent double packaging of geo-replication and other scripts
The regression-tests sub-package contains /usr/share/glusterfs/* instead
of including only the needed files. This causes some of the scripts that
are part of geo-replication to be packaged twice.

BUG: 1169005
Change-Id: Ib452e73f3c1775b252ab257aab852ad9af857e74
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/9272
Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2014-12-15 04:52:02 -08:00
Morten Johansen
46f7fd66f7 Update admin_distributed_geo_rep.md
Fixed typo

Change-Id: If4281237394ed96b32ec2d6227827214908052cf
Signed-off-by: Justin Clift <justin@gluster.org>
Reviewed-on: http://review.gluster.org/9268
Reviewed-by: M S Vishwanath Bhat <vbhat@redhat.com>
Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2014-12-14 20:51:34 -08:00
Raghavendra Bhat
1a04884411 features/snapview-client: handle fsync fop
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>
2014-12-12 08:45:03 -08:00
Niels de Vos
09af313fe6 fuse: protect checking/modifying graph->used with a mutex
While reviewing http://review.gluster.org/#/c/9060/ we noticed that fuse
checks/modifies graph->used in a unlocked way. There is a potential race
in case when fuse_graph_setup() gets called from two different threads
(currently  unlikely, but poller/notify() might change in future?).

In libgfapi we came to the conclusion that each glfs structure can be
used to protect the checking/updating of graph->used. In fuse this would
be the fuse_private_t with sync_mutex.

BUG: 1170643
Change-Id: If5ab5468d22fdb92cfb24a469f538f63f12baf78
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/9237
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
2014-12-12 06:26:02 -08:00
Harshavardhana
12c15f47fe build: FreeBSD 11-Current causes libtool to fail with '-shared'
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>
2014-12-12 01:21:49 -08:00
Niels de Vos
9ca8003921 client_t: fix for potential NULL pointer dereference
In case an error occurs, 'client' is free'd. The log message just before
exiting the function should therefore not use the structure anymore.

BUG: 789278
Change-Id: I0848328b29585057cd037a5972c4e5f06a7f978b
CID: 1226165
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/9262
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
2014-12-12 01:19:05 -08:00
Jan-Hendrik Zab
e679d6417d Stop logrotate from complaining about missing files.
Previously logrotate reported errors for files missing in
"/var/log/glusterfs/geo-replication-slaves/*/*.log". Fixed by reordering
directives in the example config.

Change-Id: I7cdb9e0d82f08aa27d5e26664660204fdeb8e98e
BUG: 1170825
Signed-off-by: Jan-Hendrik Zab <zab@l3s.de>
Reviewed-on: http://review.gluster.org/9264
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com>
2014-12-11 00:04:36 -08:00
Krishnan Parthasarathi
757394c1d7 rpc/rpcsvc: add peername to log messages
This would allow users/developers to associate rpc layer log messages
to the corresponding connection.

Change-Id: I040f79248dced7174a4364d9f995612ed3540dd4
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/8535
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
2014-12-10 22:35:03 -08:00
Pranith Kumar K
0b293a9583 storage/posix: Set errno for xattrop failures
Change-Id: I4d44068c8da5257227d62906ec18ae16f6ed6c02
BUG: 1172477
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/9261
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Tested-by: Raghavendra Bhat <raghavendra@redhat.com>
2014-12-10 10:10:50 -08:00
Niels de Vos
1877c43a65 nfs: prevent potential NULL dereference in mnt3_readlink_cbk()
In case 'mres' is NULL, we jump to 'mnterr' where 'mres->req' will be
used. This will cause a segmentation fault, which we really do not want.

Change-Id: I01d6f3aa0343def54dcd4a5610001ff7d62c8834
CID: 1256179
BUG: 789278
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/9257
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
2014-12-10 02:01:02 -08:00
Raghavendra Bhat
7cfa31434e features/snapview-client: handle readdir requests differently for samba
* 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>
2014-12-09 20:27:33 -08:00
Krutika Dhananjay
ad1ed80060 cluster/afr: Associate the inode returned by inode_link() with corresponding entry
Change-Id: Ic4436a64075a2615a2293cdfdf2ba6622827cafa
BUG: 1129939
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/9254
Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org>
Tested-by: Emmanuel Dreyfus <manu@netbsd.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
2014-12-09 20:15:21 -08:00
Vijay Bellur
ecb58c9a3f api, glusterfsd: Cleanup upon failure in glusterfs_ctx_defaults_init()
This got introduced due to 656711d935000c16. Coverity
also picked this up as CIDs 1256176, 1256178, 1256180.

Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Change-Id: If12fa0075634383975846181917a2f9650f790e3
BUG: 789278
Reviewed-on: http://review.gluster.org/9213
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
2014-12-09 20:11:17 -08:00
GauravKumarGarg
4aa63e2850 glusterd: Coverity fix for string_overflow overrun
In function glusterd_dump_peer() it is copying "input_key" into "key"
buffer without checking the length which might cause string_overflow
overrun. Similar problem with other coverity issue.
With this fix it will copy "input_key" into "key" buffer by maximum
length of buffer.

Coverity CID: 1256171
Coverity CID: 1256172
Coverity CID: 1256174

Change-Id: I4e092309d9503bd79ff82cf83ed5e8d758743453
BUG: 1093692
Signed-off-by: Gaurav Kumar Garg  ggarg <ggarg@redhat.com>
Reviewed-on: http://review.gluster.org/9208
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
2014-12-08 23:10:39 -08:00