6998 Commits

Author SHA1 Message Date
Pranith Kumar K
443e48abf9 cluster/afr: Add afr-v1 xattr compatibility
All the special cases v1 handles and also
self-accusing pending changelog from v1 pre-op also is handled
in this patch.

Change-Id: Ie10f71633fb20276f01ecafbd728f20483e7029c
BUG: 1128721
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/8536
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2014-10-01 03:29:12 -07:00
vmallika
f95a25c35e glusterd/quota: Heal pgfid xattr on existing data when the quota is
enable

The pgfid extended attributes are used to construct the ancestry path
(from the file to the volume root) for nameless lookups on files.
As NFS relies on nameless lookups heavily, quota enforcement through NFS
would be inconsistent if quota were to be enabled on a volume with
existing data.

Solution is to heal the pgfid extended attributes as a part of lookup
perfomed by quota-crawl process. In a posix lookup check for pgfid xattr
and if it is missing set the xattr.

Change-Id: I5912ea96787625c496bde56d43ac9162596032e9
BUG: 1147378
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/8878
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-09-30 09:42:02 -07:00
Emmanuel Dreyfus
c65d4ea8a1 Fix invalid seekdir() usage
According to POSIX, seekdir() should only be given offset obtained from
telldir() on the same DIR *
http://pubs.opengroup.org/onlinepubs/9699919799/functions/seekdir.html

Code from afr-self-heald.c and index.c is operating outside of the
specification, by doing using seekdir() with offset from a previously
open/close/re-open directory. This seems to work on Linux (although with
no guarantee it will always in the future). On NetBSD the seekdir()
with a in invalid offset is a nilpotent operation, and causes an infinite
loop, since index_fill_readdir() always restart from the beginning of the
directory.

The situation is fixed by using a non anonymous fd in afr-self-heald.c:
we explicitely open the directory so that it remains open on the brick
side during the timeframe where we want to reuse offsets in seekdir().
This requires adding an opendir fop in index xlator.

If the brick was not updated, the opendir will fail and we fallback
to the standard violating approach for backward compatibility on Linux.
On other systems we fail since it never worked.

While there, add tests to check seekdir() success in index and posix
xlators, so that incorrect usage from calling code produce an explicit
error instead of an infinite loop. We can only do it on non Linux systems,
for the sake of backward compatibility when the brick was updated but
not the client.

BUG: 1129939
Change-Id: I88ca90acfcfee280988124bd6addc1a1893ca7ab
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8760
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-09-30 09:40:36 -07:00
Xavier Hernandez
36d2975714 doc: added documentation for dispersed volumes
Change-Id: I8a8368bdbe31af30a239aaf8cc478429e10c3f57
BUG: 1147563
Signed-off-by: Xavier Hernandez <xhernandez@datalab.es>
Reviewed-on: http://review.gluster.org/8885
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
2014-09-30 09:37:26 -07:00
GauravKumarGarg
535c425911 glusterd: Perform brick order check in originator node.
Currently in case of multi node cluster brick-order check for
replicate volume done on every node. Its waste of time to perform
brick order check on every node.

This change will perform brick order check only at originator node.

Change-Id: I8687fd28e587de8a280a9003b015ccd5729c9740
BUG: 1091935
Signed-off-by: ggarg <ggarg@redhat.com>
Reviewed-on: http://review.gluster.org/8881
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
Tested-by: Kaushal M <kaushal@redhat.com>
2014-09-29 21:46:21 -07:00
Sachin Pandit
2736421b26 USS : Decide the log entry based on the type of graph.
Problem : When a lookup is issued, and if the entry is not found
then snapview-client will log failure stating that
"Lookup on normal graph failed with error Stale file handle"
irrespective of type of graph it received call back from.

Solution : Introduced a check to find out the graph from which
the snapview-client received call-back.

Change-Id: Iadd5b525c394be3675d40231711058e1cf1396cd
BUG: 1146479
Signed-off-by: Sachin Pandit <spandit@redhat.com>
Reviewed-on: http://review.gluster.org/8851
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-09-29 08:13:42 -07:00
Pranith Kumar K
94045e4ae7 cluster/afr: Launch self-heal only when all the brick status is known
Problem:
File goes into split-brain because of wrong erasing of xattrs.

RCA:
The issue happens because index self-heal is triggered even before all the
bricks are up. So what ends up happening while erasing the xattrs is, xattrs
are erased only on the sink brick for the brick that it thinks is up leading to
split-brain

Example:
lets say the xattrs before heal started are:
brick 2:
trusted.afr.vol1-client-2=0x000000020000000000000000
trusted.afr.vol1-client-3=0x000000020000000000000000

brick 3:
trusted.afr.vol1-client-2=0x000010040000000000000000
trusted.afr.vol1-client-3=0x000000000000000000000000

if only brick-2 came up at the time of triggering the self-heal only
'trusted.afr.vol1-client-2' is erased leading to the following xattrs:

brick 2:
trusted.afr.vol1-client-2=0x000000000000000000000000
trusted.afr.vol1-client-3=0x000000020000000000000000

brick 3:
trusted.afr.vol1-client-2=0x000010040000000000000000
trusted.afr.vol1-client-3=0x000000000000000000000000

So the file goes into split-brain.

Change-Id: I1185713c688e0f41fd32bf2a5953c505d17a3173
BUG: 1142601
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/8755
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2014-09-29 05:46:55 -07:00
Anuradha
3ba5f1d38d cluster/afr : Fix incorrect looping of index healer
Sending appropriate return value from afr_selfheal()
fixes the issue.

Credits : Krutika Dhananjay and Pranith Kumar.

Change-Id: I01dbd49476f6bfbd02028fdde1f60cc0324a1e39
BUG: 1146812
Signed-off-by: Anuradha <atalur@redhat.com>
Reviewed-on: http://review.gluster.org/8868
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
2014-09-29 02:58:23 -07:00
Harshavardhana
37ee11f4d4 Sane default for SSL on OSX
- /opt/local is not preferred anymore use /usr/local

Change-Id: I30cad4cbd28850063f26121cace05371e13bb314
BUG: 1129939
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/8872
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-09-29 01:30:44 -07:00
Ravishankar N
2a2f113068 glusterfs: allow setxattr of keys with null values.
Disk based file systems allow to get/set extended attribute key-value pairs where
value can be null. Fuse/libgfapi clients must be able to do the same on a
gluster volume.

Change-Id: Ifc11134cc07f1a3ede43f9d027554dcd10b5c930
BUG: 1135514
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/8567
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-09-29 01:13:08 -07:00
Kotresh HR
7113d873af geo-rep: Fix rename of directory syncing.
The rename of directories are captured in all distributed
brick changelogs. gsyncd processess these changelogs on
each brick parallellaly. The first changelog to get processed
will be successful. All subsequent ones will stat the 'src'
and if not present, tries to create freshly on slave. It
should be done only for files and not for directories.
Hence when this code path was hit, regular file's blob
is sent as directory's blob and gfid-access translator
was erroring out as 'Invalid blob length' with errno as
'ENOMEM'

Change-Id: I50545b02b98846464876795159d2446340155c82
BUG: 1146823
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/8865
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Venky Shankar <vshankar@redhat.com>
2014-09-28 23:32:42 -07:00
Krutika Dhananjay
cf595e84a5 cluster/afr: Fix inode leak
Change-Id: I723b65d6fcae5bd39c0daece3b2f48baf0a72166
BUG: 1145471
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/8875
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-09-28 22:30:42 -07:00
hchiramm
e26b62b1a2 spec: Change summary of glusterfs to distributed file system.
BUG:1146519
Change-Id: I9b24321d9e677b535f8d79691862cf919553d635
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
Reviewed-on: http://review.gluster.org/8844
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com>
2014-09-26 10:16:20 -07:00
Emmanuel Dreyfus
3d36edb00c Use sane OS-dependent defaults for SSL configuration
Current code assumes /etc/ssl exists, which may not be the case.
Attempt to guess sane default for a few OS.

BUG: 1129939
Change-Id: I0f3168f79b8f4275636581041740dfcaf25f3edd
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8790
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-09-26 03:32:42 -07:00
Emmanuel Dreyfus
8e57090f7d Do not forbid fallocate on non Linux systems
Linux fallocate() differs from posix_fallocate() by
an extra flag that can have the FALLOC_FL_KEEP_SIZE value;

Do not test FALLOC_FL_KEEP_SIZE existence to enable fallocate()
in posix xlator, as sys_fallocate() in libglusterfs provides
support for both implementations.

BUG: 1129939
Change-Id: Idf41a0396028a15e81281791bf6912d7fd674e3f
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8856
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-09-26 03:31:24 -07:00
Krutika Dhananjay
5123949beb cluster/afr: More dict_t leak fixes
Change-Id: I6618b7b2df0f88a3e6252f9136135cf402147a37
BUG: 1134221
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/8852
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-09-26 03:06:35 -07:00
Kaleb S. KEITHLEY
c3101c66ba glusterfs.spec.in: add psmisc to -server subpackage
apparently some minimalist installs omit psmisc
psmisc is needed for the killall in various %pre and %post scriptlets

smarter logic for restarting glusterd in %post server

Change-Id: I505573b364cc27321bb4117a387bdf71fe3ce310
BUG: 1146426
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Humble Chirammal <hchiramm@redhat.com>
Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com>
Tested-by: Lalatendu Mohanty <lmohanty@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/8867
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
2014-09-26 01:51:23 -07:00
Aravinda VK
3c29c50cf6 geo-rep: fix same file different gfid in master and slave
While processing RENAME in changelog, if the file is unlinked
in master, then geo-rep was sending UNLINK to slave instead of
RENAME.

If rsync job fails if one of the file failed to sync in the job.
This patch adds logic to remove GFID from data list if the same
changelog has UNLINK entry for it after the DATA. Or it removes
those GFIDs during retry of changelogs processing.

BUG: 1143853
Change-Id: I982dc976397cd0ab676bb912583f66a28f821926
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/8761
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Venky Shankar <vshankar@redhat.com>
2014-09-26 00:18:48 -07:00
Gaurav Kumar Garg
60a75cdca7 glusterd: file-snapshot and features-encryption options should be validate correctly
By giving non-boolean value to volume set command for features.file-snapshot
and features.encryption option the command failed after that subsequent
volume set request with valid value of the existing any volume set option
fail.

Previously when user supplies a non-boolean value in volume set command
for features.file-snapshot and features.encryption option's then
validation of that value was done by volinfo->dict but actual value
of that option store in input dictonary. Now with this change it
will refer correct dictonary for validation of supplies value.

Change-Id: I4a93d8be848cd33fdf4b4eb9b1a8d15ec9d1e66a
BUG: 1140162
Reviewed-on: http://review.gluster.org/8688
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
2014-09-25 22:52:08 -07:00
Emmanuel Dreyfus
adace43107 32 bit fix: use off_t and not size_t for truncate()
Make sure off_t and not size_t is used when holding file offsets for
ftruncate()/truncate(). It works on 64 bit machines where
sizeof(size_t) == sizeof(off_t) == 8, but breaks for big offsets on 32 bit
machines because sizeof(size_t) == 4 and sizeof(off_t) == 8

BUG: 1129939
Change-Id: Ia2637be772ba9b11731d59fdbffbd269f0ff56c8
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8742
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-09-25 10:34:18 -07:00
Bala.FA
94b0ac65c3 build: remove /sbin/ldconfig as interpreter
using /sbin/ldconfig as interpreter in pre/post/postun throws error
/sbin/ldconfig: relative path `1' used to build cache

BUG: 1145989
Change-Id: Ic321f200d92d2e49ff797965a006f63f483d29be
Signed-off-by: Bala.FA <barumuga@redhat.com>
Reviewed-on: http://review.gluster.org/8835
Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com>
Tested-by: Lalatendu Mohanty <lmohanty@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2014-09-25 10:29:28 -07:00
Krutika Dhananjay
2471aa9aa2 cluster/afr: Fix locking issues in entry self-heal
Original reporter of the bug & designer of the solution:
        Pranith Kumar K <pkarampu@redhat.com>

Change-Id: I9ed89aa92e4cd0f8049f5f6c7a3701e52989ae5e
BUG: 1128721
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/8837
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-09-24 23:39:47 -07:00
Harshavardhana
c16408ab40 OSX/FreeBSD: Regression fix
Introduced in "1f6e992f1aaa676be5bd47d17e58f1171825cf43"

Change-Id: I655cf613ca93a749ab5403cb3ec038e739993e2e
BUG: 1146279
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/8841
Reviewed-by: Justin Clift <justin@gluster.org>
Tested-by: Justin Clift <justin@gluster.org>
2014-09-24 16:23:01 -07:00
ggarg
b097225202 glusterd: Move brick order check from cli to glusterd.
Previously the brick order check for replicate volumes on volume
create and add-brick was done by the cli. This check would fail
when a hostname wasn't resolvable and would question the user
if it was ok to continue. If the user continued, glusterd would
fail the command again as the hostname wouldn't be resolvable.
This was unnecessary.

This change, moves the check from cli into glusterd. The check
is now performed during staging of volume create after the
bricks have been resolved. This prevents the above condition
from occurring.

As a result of this change, the user will no longer be
questioned and given an option to continue the operation
when a bad brick order is given or the brick order check
fails. In such a case, the user can use 'force' to bypass
the check and allow the command to succeed.

Change-Id: I009861efaf3fb7f553a9b00116a992f031f652cb
BUG: 1091935
Signed-off-by: ggarg <ggarg@redhat.com>
Reviewed-on: http://review.gluster.org/7589
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
2014-09-24 05:29:43 -07:00
Pranith Kumar K
70d76f20ee cluster/afr: Fix spurious metadata self-heals
- Added logging for metadata and data self-heals which helped
  in debugging this issue.
- Added checks to skip self-heals when no sinks are available to heal

Change-Id: I0d50dceb84cd9ad4fe00e0b749ddf7d4ff42348a
BUG: 1128721
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/8709
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2014-09-24 01:51:35 -07:00
Vijay Bellur
bd592f8b83 protocol: Log ENODATA & ENOATTR logs at DEBUG loglevel in removexattr_cbk.
Prevents messages of the following type from being seen by default in the log files:

[2014-09-19 07:57:39.877806] W
[client-rpc-fops.c:1232:client3_3_removexattr_cbk] 0-<volume_name>-client-0:
remote operation failed: No data available
[2014-09-19 07:57:39.877963] W
[client-rpc-fops.c:1232:client3_3_removexattr_cbk] 0-<volume_name>-client-1:
remote operation failed: No data available

Change-Id: I3b1a121b0fc272eb772547275bb8085ed19db5a1
BUG: 1144527
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/8781
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
2014-09-24 00:48:59 -07:00
Anuradha
3b871bee4a cluster/afr: Fixed mem leaks in self-heal code path.
AFR_STACK_RESET previously didn't cleanup afr_local_t,
leading to memory leaks. With this patch, cleanup is
done.

All credit goes to Pranith Kumar Karampuri.

Change-Id: I3c727ff4bb323dccb81da4b3168ac69bb340d17d
BUG: 1145471
Signed-off-by: Anuradha <atalur@redhat.com>
Reviewed-on: http://review.gluster.org/8821
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-09-23 23:16:37 -07:00
Jeff Darcy
6e8ad12fba build: remove warnings for recommended style
Specifically:

 * space before function arguments

 * brace around single statement

Ideally we would *reverse* these tests so they warn under the exact
opposite conditions, but that would mean learning the internals of a
script written in a defective language with cryptic variable names and
too few comments.  Life's too short.  For now, just cutting down on some
of the spam (which might obscure more serious issues) should suffice.

BUG: 1120646
Change-Id: I5ec684d0d788a34f29af9b1761743c8860973993
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/8813
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: Harshavardhana <harsha@harshavardhana.net>
2014-09-23 14:30:13 -07:00
Harshavardhana
2288fec13e extras/checkpatch.pl: update coding guidelines script
- Allow 'quoted string split across lines' since its a
  GlusterFS common practice
- Remove a useless "+" - perl 5.20 complains with following
  warning "Useless use of greediness modifier '+'"

Change-Id: Ibaf276ec84757b3ecc3e6db7f5e720b8e8a12dff
BUG: 1120646
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/8811
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
2014-09-23 12:29:17 -07:00
Sachin Pandit
6ddfdde6fb doc/snapshot : admin guide updation.
Change-Id: I1980bc0984f941cd415fbc754495353f561155a8
BUG: 1145069
Signed-off-by: Sachin Pandit <spandit@redhat.com>
Reviewed-on: http://review.gluster.org/8817
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-09-23 10:23:56 -07:00
Emmanuel Dreyfus
5136c938dd Do not hardcode setfattr(1) path
Turn setfattr(1) absolute path into an OS-dependant macro. Let compiler
option override it to fit custom installation if needed.

BUG: 1129939
Change-Id: I8f469c5741a85b6e8d8f6299a9540b3d64611d2f
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8786
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-09-23 09:52:39 -07:00
Xavier Hernandez
5f79d6e08f ec: Add config information in an xattr
To simplify backward compatibility of the ec xlator when some
parameter or the implementation itself is changed, a new xattr
is added to each file with the configuration needed to recover
it.

The new attribute is called 'trusted.ec.config', and it's a 64-bit
value containing the following information:

    8 bits: version of the config information (currently always 0)
    8 bits: algorithm used to encode the file (currently always 0)
    8 bits: size of the galois field (currently always 8)
    8 bits: number of bricks
    8 bits: redundancy
   24 bits: chunk size (currently 512)

This new xattr could allow, in a future version, to have different
configurations per file.

Change-Id: I8c12d40ff546cc201fc66caa367484be3d48aeb4
BUG: 1140861
Signed-off-by: Xavier Hernandez <xhernandez@datalab.es>
Reviewed-on: http://review.gluster.org/8770
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-09-23 09:12:32 -07:00
Sachin Pandit
933e5bd5a7 test : Fix for spurious failure
Problem : Once the features.uss is enabled it does not wait for
the process to be created. And if we try to check for
the pid of the snapd then it will not be present which
causes a failure.

Solution : Adding a EXPECT_WITHIN which waits to get the pid
until certain time period.

Change-Id: If075860173a996f9eee13b346e939686b94ec3f6
BUG: 1145450
Signed-off-by: Sachin Pandit <spandit@redhat.com>
Reviewed-on: http://review.gluster.org/8814
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-09-23 08:50:00 -07:00
Krutika Dhananjay
125e5428d3 cluster/afr: Do not reset pending xattrs on gfid or type mismatch in entry-sh
Change-Id: Ie27219a376382e2455a0fcc094f8b7eb243738ae
BUG: 1140613
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/8816
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-09-23 07:25:07 -07:00
Pranith Kumar K
e149a051bf cluster/afr: Don't start heal when lookup succeeds on < 2 children
Problem:
When self-heal code doesn't see at least 2 successes on looking up children,
then self-heal can't be done. What is happening now is if all the lookups fail
then the pending changelog is all zeros in xattrs so all the children are
becoming sources and leading to crashes when the code paths further assume that
some data structures are populated properly

Fix:
Don't proceed with self-heals when < 2 children succeed lookups.

BUG: 1128721
Change-Id: Iffdf0feebb6f98812d9d01cdd0cf97f3e19ba76f
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/8698
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2014-09-23 07:21:44 -07:00
Kaushal M
371bb42410 glusterd: Authenticate management handshake requests
Management handshake requests, which are used to validate op-version
supported by the peers, are now only allowed if,
- the glusterd doesn't have any other peer, or
- the request was sent by another peer.

This prevents the op-version of a peer being changed because of a
connection attempt by an invalid peer.

Change-Id: I248c386ed5ec4f8360e7b5e7f9ab74b7e8a7fc65
BUG: 1109741
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/8126
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
2014-09-23 02:17:58 -07:00
Venkatesh Somyajulu
f14d9bdd52 cluster/dht: Modified the calculation of brick_count
Whenever new_layout is calculated for a directory,
we calculate the number of childs of dht, who will get
the actual(Non-zero) layout-range, and assign range
to only those subvolume and other will get 0 as
their layout->start and layout->stop value.

This calculation is based on either
a) weight_by_size or
b) number of brick who will be assigned the non-zero range

So if in case we are not assigning the layout based
on weight_by_size, we should choose the "bricks_to_use"
instead of "bricks_used".

In regression test,
we found that priv->du_stat[0].chunks was zero. In this
case "bricks_used" variable will be zero, which will cause
crash for

chunk = ((unsigned long) 0xffffffff) / bricks__used;
calculation.

Change-Id: I6f1b21eff972a80d9eb22771087c1e2f53e7e724
BUG: 1143835
Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com>
Reviewed-on: http://review.gluster.org/8792
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
2014-09-22 22:50:28 -07:00
hchiramm
de713588b8 doc: Include details of thin volume creation in snapshot guide.
Change-Id: I12b49c0e8af2cc3d91c29300fdfc47d772d380d7
Signed-off-by: hchiramm <hchiramm@redhat.com>
Reviewed-on: http://review.gluster.org/8791
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-09-22 06:23:32 -07:00
Krishnan Parthasarathi
58f23090fc synctask: add backtrace per waiting task
The backtrace is 'saved' in a per-task buffer.
This would come handy while debugging code using
synctasks.

Change-Id: I732b275f6d15b31f31361f5ecf2ba47cacde9b54
BUG: 1138503
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/8622
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-09-22 04:17:11 -07:00
Krishnan Parthasarathi
1b53756e50 glusterd: Add last successful glusterd lock backtrace
Also, moved the backtrace fetching logic to a separate function.
Modified the backtrace fetching logic able to work under memory pressure
conditions.

Change-Id: Ie38bea425a085770f41831314aeda95595177ece
BUG: 1138503
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/8584
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
2014-09-22 04:08:58 -07:00
Kaleb S. KEITHLEY
0cbfe677f3 tests: regression, can't run prove $t in subdirs
In various tests we already use the pattern:

  . $(dirname $0)/../include.rc

to locate various .rc files.

Use the same pattern we already use to also find the new env.rc

Change-Id: I0d438446fa00be2c143b5cf46025866182c94814
BUG: 1142419
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/8754
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-09-21 10:30:19 -07:00
Krutika Dhananjay
258e61adb5 cluster/dht: Fix dict_t leaks in rebalance process' execution path
Two dict_t objects are leaked for every file migrated in success codepath.
It is the caller's responsibility to unref dict that it gets from calls to
syncop_getxattr(); and rebalance performs two syncop_getxattr()s per file
without freeing them.

Also, syncop_getxattr() on GF_XATTR_LINKINFO_KEY doesn't seem to be using
the response dict. Hence, NULL is now passed as opposed to @dict to
syncop_getxattr().

Change-Id: I5a4b5ab834df3633dea994f239bbdbc34cbe9259
BUG: 1142052
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/8763
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-09-19 07:10:24 -07:00
Gu Feng
fb6702b7f8 socket: Fixed parsing RPC records containing multi fragments
In __socket_proto_state_machine(), when parsing RPC records containing
multi fragments, just change the state of parsing process, had not
processed the memory to coalesce the multi fragments.

Change-Id: I5583e578603bd7290814a5d26885b31759c73115
BUG: 1139598
Signed-off-by: Gu Feng <flygoast@126.com>
Reviewed-on: http://review.gluster.org/8662
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
2014-09-19 05:37:05 -07:00
Xavier Hernandez
0ee0cfae80 ec: Fix invalid inode lock in ftruncate
The fops 'truncate' and 'ftruncate' share some code and inodelk()
was always made against the inode inside the loc_t structure
instead of that of fd_t. Since ftruncate has the loc initialized
to NULL, this fop was executed without any lock, allowing some
concurrent modifications in the file size.

Also changed the way in which 'fop' and 'ffop' are differentiated
in shared code. Now it uses 'id' field instead of checking if 'fd'
is NULL.

Change-Id: Ibd18accf2652193b395a841b9029729e5f4867c6
BUG: 1140396
Signed-off-by: Xavier Hernandez <xhernandez@datalab.es>
Reviewed-on: http://review.gluster.org/8695
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-09-19 03:05:25 -07:00
Xavier Hernandez
f32378b660 ec: Fix some size_t vars to 64 bits even on 32 bits machines
The 64 bits 'trusted.ec.size' extended attribute was incorrectly
computed on 32 bits machines due to an overflow on negative
numbers.

Also changed some potentially dangerous uses of size_t in other
places.

Change-Id: Id76cfe49a2f350e564b5c71d8c8644fb9ce86662
BUG: 1125312
Signed-off-by: Xavier Hernandez <xhernandez@datalab.es>
Reviewed-on: http://review.gluster.org/8738
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-09-19 03:02:47 -07:00
Harshavardhana
c788a7784d extras/checkpatch.pl: linux kernel style patch verification
This is to bring in adherence to coding policy, prior to patch
submission for review.

 - no tabs
 - no whitespace
 - indentation (linux style) etc.

This is in the interest at large for the GlusterFS codebase
to be more cleaner and readable.

./rfc.sh - now supports running this for all patches diverged
from "origin/master" revision.

NOTE: One should take this as a handle for good guidelines and
never use it as a tool for correctness, use common-sense in all
the cases ;-)

Change-Id: Ib9a5ed207cde152cb92b8d38cec83e8ce9ef7f28
BUG: 1120646
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/8181
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anders Blomdell <anders.blomdell@control.lth.se>
2014-09-18 12:55:26 -07:00
Raghavendra G
1e1b709a4b storage/posix: Log when mkdir is on an existing gfid but non-existent
path.

consider following steps on a distribute volume

1. rename (src, dst) on hashed subvolume
2. snapshot taken
3. restore snapshots and do stat on src and dst

Now, we end up with two directories src and dst having same gfid,
because of distribute creating directories on non-existent subvolumes
as part of directory healing.

This can happen even with race between rename and directory healing in
dht-lookup. This can lead to undefined behaviour while accessing any
of both directories. Hence, we are logging paths of both
directories, so that a sysadmin can take some corrective action when
(s)he sees this log. One of the corrective action can be to copy
contents of both directories from backend into a new directory and
delete both directories.

Since effort involved to fix this issue is non-trivial, giving this
workaround till we come up with a fix.

Change-Id: I38f4520e6787ee33180a9cd1bf2f36f46daea1ea
BUG: 1105082
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-on: http://review.gluster.org/8008
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
2014-09-18 10:15:55 -07:00
Vijay Bellur
331e9e2051 syncop: Invoke dict_unref() in inodelk only if dictionary is not NULL
In the absence of this check, logs can get flooded with messages like this when rebalance is run:

[2014-09-04 17:48:07.148262] W [dict.c:480:dict_unref] (-->/lib64/libc.so.6()
[0x30daa47a00] (-->/usr/local/lib/libglusterfs.so.0(synctask_wrap+0x12)
[0x7fa20b7c6ec2]
(-->/usr/local/lib/glusterfs/3.7dev/xlator/cluster/distribute.so(dht_migrate_file+0x23f)
[0x7fa200fdb58f]))) 0-dict: dict is NULL


Change-Id: I4c93e4485293b35d86ba07df4d583d2758ec3f49
BUG: 1130888
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/8601
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
2014-09-17 07:13:50 -07:00
Anuradha
6f5bb1bfc5 cluster/afr: Set all the xattrs needed by index xlator
Index xlator removes the index file from indices
xattrop directory in case the value for keys sent
are zero.

If all the required keys are not set by afr
then index file might be removed in an invalid
way.

With this change all the keys required by index
xlator are set by afr such that invalid removal of
files does not occur.

Change-Id: Idbed0764a95157fd5cab8d6685057a43788fc7df
BUG: 1139230
Signed-off-by: Anuradha <atalur@redhat.com>
Reviewed-on: http://review.gluster.org/8652
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-09-16 19:49:32 -07:00
Emmanuel Dreyfus
68e062ea6e Regression test portability: arequal-checksum
Emulate GNU libc extension FTW_SKIP_SUBTREE for system that lack it.
FTW_ACTIONRETVAL is another GNU libc extension we just ignore now.

BUG: 764655
Change-Id: I25d9641055a30fe72b4e248f51b53b2a3ba637e9
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8427
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2014-09-16 05:18:33 -07:00