5407 Commits

Author SHA1 Message Date
Pranith Kumar K
5c00a6c816 cluster/ec: Wind unlock fops at all cost
Problem:
While files are being created if more than redundancy number of bricks
go down, then unlock for these fops do not go to the bricks. This will
lead to stale locks leading to hangs.

Fix:
Wind unlock fops at all costs.

Change-Id: I50a87e8b4d6d2dde5bf7405b82e3aeecd95ad00e
BUG: 1220348
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/11152
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
2015-06-10 23:37:07 -07:00
Niels de Vos
ec7d0c3de1 logging: log "Stale filehandle" on the client as Debug
There are valid use-cases where a "Stale filehandle" is expected. One of
these is deleting a file through NFS-Ganesha. When the "filename" is
deleted, Ganesha will stat the file-handle to update its attributes. The
file-handle would still be valid in the case where there are hardlinks.

There is no need to log "Stale filehandle" as Warning. It is perfectly
fine to have this logged as Debug.

Change-Id: Ib9006d95a5d1f7dd394bf5d5994ad70740ad4ab2
BUG: 1228731
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/11107
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: soumya k <skoduri@redhat.com>
Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
2015-06-10 16:01:58 -07:00
Mohamed Ashiq
00f9a61fe8 changetimerecorder : Porting to new logging framework
Change-Id: I66e7ccc5e62482c3ecf0aab302568e6c9ecdc05d
BUG: 1194640
Signed-off-by: Mohamed Ashiq <ashiq333@gmail.com>
Reviewed-on: http://review.gluster.org/10938
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Joseph Fernandes
2015-06-10 01:58:01 -07:00
Sakshi Bansal
9374b2ef41 glusterd: coverity fix for string overflow
Coverity CID: 1222523
Coverity CID: 1210990
Coverity CID: 1229877
Coverity CID: 1229876
Coverity CID: 1124855

Change-Id: Iba615724909216f923074cb4585940b919d02166
BUG: 789278
Signed-off-by: Sakshi Bansal <sabansal@redhat.com>
Reviewed-on: http://review.gluster.org/9555
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
2015-06-10 01:50:04 -07:00
arao
9307b94394 glusterd: Dereference after null check
CID: 1124588
CID: 1124589
CID: 1124590
CID: 1124591
Either the null pointer is dereferenced before the null check
or the check for null is unnecessary

Change-Id: I87c6b09a4b89c33afd402866e6e249fefb1330f0
BUG: 789278
Signed-off-by: arao <arao@redhat.com>
Reviewed-on: http://review.gluster.org/9636
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
2015-06-10 01:38:59 -07:00
Mohammed Rafi KC
f6a062044a tier/volume set: Validate volume set option for tier
Volume set option related to tier volume can only be set
for tier volume, also currently all volume set i for tier
option accepts a non-negative integer. This patch validate
both condition.

Change-Id: I3611af048ff4ab193544058cace8db205ea92336
BUG: 1216960
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Signed-off-by: Dan Lambright <dlambrig@redhat.com>
Reviewed-on: http://review.gluster.org/10751
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Joseph Fernandes
2015-06-10 01:08:47 -07:00
Shyam
ce2488ac2a cluster/dht: Increment op-version for lookup-optimize to 3.7.2
3.7.1 has already shipped, so carrying this configuration option
at that op-version will break compatibility. As a result bumping
this to 3.7.2.

Change-Id: I603d82184ec10d0ea3edf550490e960a8523d572
BUG: 1227894
Signed-off-by: Shyam <srangana@redhat.com>
Reviewed-on: http://review.gluster.org/11073
Reviewed-by: N Balachandran <nbalacha@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
2015-06-09 07:40:15 -07:00
Soumya Koduri
b77c8ddda8 Upcall/cache-invalidation: Ignore fops with frame->root->client not set
Server-side internally generated fops like 'quota/marker' will
not have any client associated with the frame. Hence we need a
check for clients to be valid before processing for upcall cache
invalidation. Also fixed an issue with initializing reaper-thread.

Added a testcase to test the fix.

Change-Id: If7419b98aca383f4b80711c10fef2e0b32498c57
BUG: 1227204
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Reviewed-on: http://review.gluster.org/10909
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
2015-06-09 06:46:20 -07:00
Pranith Kumar K
31866a490e cluster/ec: Prevent double unwind
Problem:
1) ec_access/ec_readlink_/ec_readdir[p] _cbks are trying to recover only from
ENOTCONN.
2) When the fop succeeds it unwinds right away. But when its
ec_fop_manager resumes, if the number of bricks that are up is less than
ec->fragments, the the state machine will resume with -EC_STATE_REPORT which
unwinds again. This will lead to crashes.

Fix:
- If fop fails retry on other subvols, as ESTALE/ENOENT/EBADFD etc are also
recoverable.
- unwind success/failure in _cbks

Change-Id: I2cac3c2f9669a4e6160f1ff4abc39f0299303222
BUG: 1228952
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/11111
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2015-06-08 22:09:20 -07:00
Krutika Dhananjay
7ca78f7a64 cluster/afr: Do not attempt entry self-heal if the last lookup on entry failed on src
Test bug-948686.t was causing shd to dump core due to gfid being NULL.
This was due to the volume being stopped while index heal's in progress,
causing afr_selfheal_unlocked_lookup_on() to fail sometimes on the src brick
with ENOTCONN. And when afr_selfheal_newentry_mark() copies the gfid off the
src iatt, it essentially copies null gfid. This was causing the assertion
as part of xattrop in protocol/client to fail.

Change-Id: I237a0d6b1849e4c48d7645a2cc16d9bc1441ef95
BUG: 1229172
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/11119
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-06-08 20:24:23 -07:00
Ashish Pandey
f57c2d1ecb Changing log level to DEBUG in case of ENOENT
Change-Id: I264e47ca679d8b57cd8c80306c07514e826f92d8
BUG: 1193388
Signed-off-by: Ashish Pandey <aspandey@redhat.com>
Reviewed-on: http://review.gluster.org/10784
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
2015-06-08 06:19:15 -07:00
anand
0dff9120d5 glusterd: Stop tcp/ip listeners during glusterd exit
Problem : Because of race between exit thread and rpc thread
causing the glusterd crash while glusterd exiting/stoping.

Fix : Stop tcp/ip socket listeners in cleanup_and_exit to
avoid new rpc events.

Change-Id: Ie9280c8c9d7c350a176529375d861432f3de94ac
BUG: 1209461
Signed-off-by: anand <anekkunt@redhat.com>
Reviewed-on: http://review.gluster.org/10197
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Kaushal M <kaushal@redhat.com>
2015-06-07 23:12:27 -07:00
Prasanna Kumar Kalever
f5095fdb7a gfid-access: Remove dead increment (dead store)
This patch remove stores to variables that are no longer live.

Change-Id: Ib6acd8c70cbb7ea875c01b7cfd6620ac1d641d36
BUG: 1223378
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Reviewed-on: http://review.gluster.org/10841
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
2015-06-07 13:28:45 -07:00
Pranith Kumar K
3373379303 cluster/ec: Don't handle EC_XATTR_DIRTY in response
Problem:
ec_update_size_version expects all the keys it did xattrop with to come in
response so that it can set the values again in ec_update_size_version_done.
But EC_XATTR_DIRTY is not combined so the value won't be present in the
response. So ctx->post/pre_dirty are not updated in
ec_update_size_version_done. So these values are still non-zero. When
ec_unlock_now is called as part of flush's unlock phase it again tries to
perform same xattrop for EC_XATTR_DIRTY. But ec_update_size_version is not
expected to be called in unlock phase of flush because ec_flush_size_version
should have reset everything to zero and unlock is never invoked from
ec_update_size_version_done for flush/fsync/fsyncdir. This leads to stale lock
which leads to hang.

Fix:
EC_XATTR_DIRTY is removed in ex_xattrop_cbk and is never combined with other
answers. So remove handling of this in the response.

Change-Id: If0ea3efec3235a6e312465d8838585fbe752c7ea
BUG: 1227654
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/11078
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2015-06-06 22:35:43 -07:00
Ravishankar N
02ccab9257 glusterd/ afr: remove the readdir-failover option from rebalance process
Remove the "replicate*.readdir-failover=off" xlator option from
rebalance process' runner arguments because this is the default behaviour in
afr-v2. i.e. reaaddir failover happens only if it is a new readdir
(offset=0). 'Continuing'readdirs are always wound on the same child
where the first readdir had happened and if that child is down, the
readdir fails.

The option cannot be removed from glusterd_volopt_map because there is a
chance of ending up in peer rejected state in a heterogenous cluster
(typical upgrade scenario) due to volinfo checksum mismatch. TODO:come up with
some warning message to the user for such deprecated options if a volume
set is attempted.

Change-Id: I6a33dc9fae7cccea8c5fd3d9de40d88d13ad3689
BUG: 1225328
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/10935
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Reviewed-by: Anuradha Talur <atalur@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
2015-06-05 04:25:15 -07:00
Avra Sengupta
bf3a6dcdf3 snapshot: Fix finding brick mount path logic
Previously while finding brick mount paths
of snap volume's bricks, we were taking brick order
into consideration. This logic fails when a brick is
removed or a tier is added.

Hence modifying the logic to look for the first
occurence of the word "brick" in the brick path.
From there we iterate till we find a '/'. The string
till the first '/' after we encounter the word brick
is the brick mount path.

Change-Id: Ic85983c4e975e701cdfd4e13f8e276ac391a3e49
BUG: 1227646
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/11060
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
2015-06-05 02:22:00 -07:00
Vijay Bellur
d2d7afefd8 features/marker: Cleanup loc in case of errors
Missing loc_wipe() for error paths in mq_readdir_cbk() can
cause memory leaks. loc_wipe() is now done for both happy
and unhappy paths.

Change-Id: I882aa5dcca06e25b56a828767fb2b91a1efaf83b
BUG: 1227904
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/11074
Reviewed-by: Sachin Pandit <spandit@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
2015-06-04 22:37:49 -07:00
Mohammed Rafi KC
f1c20897cc uss: Take ref on root inode
If we recieve a statfs call on snap directory, we will redirect
the call into the root, by creating a new root loc. So it is better to
take a ref on the root inode.
(http://review.gluster.org/#/c/10358/5/xlators/features/
snapview-client/src/snapview-client.c)

Change-Id: I5649addac442d391b2550346b115dec58fed5b86
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/10750
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
2015-06-04 04:49:03 -07:00
Avra Sengupta
402589f58c glusterd/shared_storage: Provide a volume set option to create and mount the shared storage
Introducing a global volume set option(cluster.enable-shared-storage)
which helps create and set-up the shared storage meta volume.

gluster volume set all cluster.enable-shared-storage enable

On enabling this option, the system analyzes the number of peers
in the cluster, which are currently connected, and chooses three
such peers(including the node the command is issued from). From these
peers a volume(gluster_shared_storage) is created. Depending on the
number of peers available the volume is either a replica 3
volume(if there are 3 connected peers),  or a replica 2 volume(if there
are 2 connected peers). "/var/run/gluster/ss_brick" serves as the
brick path on each node for the shared storage volume. We also mount
the shared storage at "/var/run/gluster/shared_storage" on all the nodes
in the cluster as part of enabling this option. If there is only one node
in the cluster,  or only one node is up then the command will fail

Once the volume is created, and mounted the maintainance of the
volume like adding-bricks, removing bricks etc., is expected to
be the onus of the user.

On disabling the option, we provide the user a warning, and on
affirmation from the user we stop the shared storage volume, and unmount
it from all the nodes in the cluster.

gluster volume set all cluster.enable-shared-storage disable

Change-Id: Idd92d67b93f444244f99ede9f634ef18d2945dbc
BUG: 1222013
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/10793
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
2015-06-04 02:37:19 -07:00
Gaurav Kumar Garg
1a0d76fa14 glusterd: do not show pid of brick in volume status if brick is down.
glusterd is currently showing pid of brick in volume status if brick
goes down.

It should not show pid of brick if brick is down.

Change-Id: I077100d96de381695b338382808bd8c37bf625c7
BUG: 1223772
Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com>
Reviewed-on: http://review.gluster.org/10877
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Nekkunti <anekkunt@redhat.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
2015-06-03 23:59:58 -07:00
Gaurav Kumar Garg
79d8916929 bitrot/glusterd: scrub option should be disabled once bitrot option is reset
Scrubber options should be disabled from the dictionary if user reset
bitrot option.

Change-Id: Ic7e390cf88b9b749f0ada8bbd4632f4cc0c4aff9
BUG: 1220713
Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com>
Reviewed-on: http://review.gluster.org/10936
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
2015-06-03 23:37:59 -07:00
Pranith Kumar K
2b7ae84a5f features/quota: Fix ref-leak
Change-Id: I0b44b70f07be441e044d9dfc5c2b64bd5b4cac18
BUG: 1207735
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/11045
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
2015-06-03 21:42:26 -07:00
Niels de Vos
b8b59fea78 nfs: allocate and return the hashkey for the auth_cache_entry
The allocation of the hashkey was never returned to the calling
function.

Allocating it with alloca() puts it on the stack, returning from the
function makes the pointer invalid. Functions that are annotated with
"inline" and call alloca(), will not always be inlined. Returning a
pointer allocated with alloca() is in those cases not correct. One such
confirmation was provided by GCC developer Alexandre Oliva:
 - http://gcc.gnu.org/ml/gcc-help/2004-04/msg00158.html

It is more correct to call GF_MALLOC() and GF_FREE() for the hashkey. If
this would result in preformance hit, we can always think of using
alloca() again and turn make_hashkey() into a macro (yuck).

Change-Id: Ia86a1f79d33240af4713bfb92f702b0ee6e87eb7
BUG: 1226714
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/11019
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
Reviewed-by: soumya k <skoduri@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2015-06-03 12:50:56 -07:00
Krutika Dhananjay
990cb828a2 features/shard: Handle symlinks appropriately in fops
(f)stat, unlink and rename must skip doing inode_ctx_get()
of shard block size on symbolic links.

Change-Id: I68688532164dd2ab491ff5c59b343174f8c4ce7f
BUG: 1223759
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/10995
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
2015-06-03 06:37:07 -07:00
Ravishankar N
da111ae214 afr: honour selfheal enable/disable volume set options
afr-v1 had the following volume set options that are used to enable/ disable
self-heals from happening in AFR xlator when loaded in the client graph:
cluster.metadata-self-heal
cluster.data-self-heal
cluster.entry-self-heal

In afr-v2, these 3 heals can happen from the client if there is an inode
refresh. This patch allows such heals to proceed only if the corresponding
volume set options are set to true.

Change-Id: I8d97d6020611152e73a269f3fdb607652c66cc86
BUG: 1226507
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/11012
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
2015-06-03 03:50:47 -07:00
Nithya Balachandran
9684b90526 cluster/dht: fix incorrect dst subvol info in inode_ctx
Stashing additional information in the inode_ctx to help
decide whether the migration information is stale, which could
happen if a file was migrated several times but FOPs only detected
the P1 migration phase. If no FOP detects the P2 phase, the inode
ctx1 is never reset.
We now save the src subvol as well as the dst subvol in the
inode ctx. The src subvol is the subvol on which the FOP was sent
when the mig info was set in the inode ctx. This information is
considered stale if:
1. The subvol on which the current FOP is sent is the same as
the dst subvol in the ctx
2. The subvol on which the current FOP is sent is not the same
as the src subvol in the ctx

This does not handle the case where the same file might have been
renamed such that the src subvol is the same but the dst subvol
is different. However, that is unlikely to happen very often.

Change-Id: I05a2e9b107ee64750c7ca629aee03b03a02ef75f
BUG: 1142423
Signed-off-by: Nithya Balachandran <nbalacha@redhat.com>
Reviewed-on: http://review.gluster.org/10834
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
2015-06-02 22:36:17 -07:00
Raghavendra G
b6eda067d2 cluster/dht: pass a destination subvol to fop2 variants to avoid races.
The destination subvol used in the fop2 variants is either stored in
inode-ctx1 or local->cached_subvol. However, it is not guaranteed that
a value stored in these locations before invocation of fop2 is still
present after the invocation as these locations are shared among
different concurrent operations. So, to preserve the atomicity of
"check dst-subvol and invoke fop2 variant if dst-subvol found", we
pass down the dst-subvol to fop2 variant.

This patch also fixes error handling in some fop2 variants.

Change-Id: Icc226228a246d3f223e3463519736c4495b364d2
BUG: 1142423
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-on: http://review.gluster.org/10943
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: N Balachandran <nbalacha@redhat.com>
2015-06-02 22:33:00 -07:00
Krutika Dhananjay
b7842d178a features/shard: Fix incorrect parameter to get_lowest_block()
Due to get_lowest_block() being a macro, what needs to be passed
to it is the evaluation of the expression (local->offset - 1), without
which its substitution can cause junk values to be assigned to
local->first_block.

This patch also fixes calls to get_highest_block() where if offset and
size are both equal to zero, it could return negative values.

Change-Id: I3ae918a0a3251ffd9ce8d2294bc5f9b681447627
BUG: 1200082
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/10804
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
2015-06-02 20:46:56 -07:00
Xavier Hernandez
29d5bd5fc8 cluster/ec: Fix incorrect check for iatt differences
A previous patch (http://review.gluster.org/10974) introduced a
bug that caused that some metadata differences could not be
detected in some circumstances. This could cause that self-heal
is not triggered and the file not repaired.

We also need to consider all differences for lookup requests, even
if there isn't any lock. Special handling of differences in lookup
is already done in lookup specific code.

Change-Id: I3766b0f412b3201ae8a04664349578713572edc6
BUG: 1225793
Signed-off-by: Xavier Hernandez <xhernandez@datalab.es>
Reviewed-on: http://review.gluster.org/11018
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
2015-06-02 19:46:35 -07:00
Mohammed Rafi KC
3a94f4c52b tiering:static function called from a non static inline function
gcc v5.1.1 throws warning for calling a static function from a
non-static inline function.


<snippet from compiler warning>
  CC       tier.lo
tier.c:610:15: warning: 'tier_migrate_using_query_file' is static but used in inline function 'tier_migrate_files_using_qfile' which is not static
         ret = tier_migrate_using_query_file ((void *)query_cbk_args);
               ^
tier.c:585:47: warning: 'tier_process_brick_cbk' is static but used in inline function 'tier_build_migration_qfile' which is not static
         ret = dict_foreach (args->brick_list, tier_process_brick_cbk,
                                               ^
tier.c:565:176: warning: 'demotion_qfile' is static but used in inline function 'tier_build_migration_qfile' which is not static
tier.c:565:158: warning: 'promotion_qfile' is static but used in inline function 'tier_build_migration_qfile' which is not static
tier.c:563:58: warning: 'demotion_qfile' is static but used in inline function 'tier_build_migration_qfile' which is not static
tier.c:563:40: warning: 'promotion_qfile' is static but used in inline function 'tier_build_migration_qfile' which is not static
         ret = remove (GET_QFILE_PATH (is_promotion));
                                        ^
  CCLD     tier.la

</snip>

Change-Id: I46046feeb79ab4e2724b0ba6b02c9ec8b121ff4e
BUG: 1226881
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/11032
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Anoop C S <achiraya@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
2015-06-02 15:00:04 -07:00
Jeff Darcy
62992ac27d stripe: fix use-after-free
Pretty much a classic case.  STRIPE_STACK_UNWIND frees the "local"
structure.  In the "virtual xattr" path, used for lock recovery among
other things, we were calling STRIPE_STACK_UNWIND and then continuing to
clean up "our" parts of the just-freed structure.  Oops.

Change-Id: Ifa961b89cd21a2893de39a9eea243d184f9eac46
BUG: 1222317
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/11037
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
2015-06-02 14:54:59 -07:00
Dan Lambright
5a66d1e618 cluster/tier: make attach/detach work with new rebalance logic
The new rebalance performance improvements added new
datastructures which were not initialized in the
tier case. Function dht_find_local_subvol_cbk() needs
to accept a list built by lower level DHT translators
in order to build the local subvolumes list.

Change-Id: Iab03fc8e7fadc22debc08cd5bc781b9e3e270497
BUG: 1222088
Signed-off-by: Dan Lambright <dlambrig@redhat.com>
Reviewed-on: http://review.gluster.org/10795
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
2015-06-02 04:27:40 -07:00
Shyam
9f29401791 dht: Add lookup-optimize configuration option for DHT
Currently with commit 4eaaf5 a mixed version cluster would
have issues if lookup-uhashed is set to auto, as older clients
would fail to validate the layouts if newer clients (i.e 3.7 or
upwards) create directories. Also, in a mixed version cluster
rebalance daemon would set commit hash for some subvolumes and
not for the others.

This commit fixes this problem by moving the enabling of the
functionality introduced in the above mentioned commit to a
new dht option. This option also has a op_version of 3_7_1
thereby preventing it from being set in a mixed version
cluster. It brings in the following changes,
- Option can be set only if min version of the cluster is
3.7.1 or more
- Rebalance and mkdir update the layout with the commit hashes
only if this option is set, hence ensuring rebalance works in a
mixed version cluster, and also directories created by newer
clients do not cause layout errors when read by older clients
- This option also supersedes lookup-unhased, to enable the
optimization for lookups more deterministic and not conflict
with lookup-unhashed settings.

Option added is cluster.lookup-optimize, which is a boolean.

Usage: # gluster volume set VOLNAME cluster.lookup-optimize on

Change-Id: Ifd1d4ce3f6438fcbcd60ffbfdbfb647355ea1ae0
BUG:  1222126
Signed-off-by: Shyam <srangana@redhat.com>
Reviewed-on: http://review.gluster.org/10797
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Kaushal M <kaushal@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
2015-06-02 03:03:07 -07:00
Avra Sengupta
2df57ab7dc glusterd/snapshot: Return correct errno in events of failure - PATCH 2
ENUM           RETCODE        ERROR
-------------------------------------------------------------
EG_INTRNL      30800          Internal Error
EG_OPNOTSUP    30801          Gluster Op Not Supported
EG_ANOTRANS    30802          Another Transaction in Progress
EG_BRCKDWN     30803          One or more brick is down
EG_NODEDWN     30804          One or more node is down
EG_HRDLMT      30805          Hard Limit is reached
EG_NOVOL       30806          Volume does not exist
EG_NOSNAP      30807          Snap does not exist
EG_RBALRUN     30808          Rebalance is running
EG_VOLRUN      30809          Volume is running
EG_VOLSTP      30810          Volume is not running
EG_VOLEXST     30811          Volume exists
EG_SNAPEXST    30812          Snapshot exists
EG_ISSNAP      30813          Volume is a snap volume
EG_GEOREPRUN   30814          Geo-Replication is running
EG_NOTTHINP    30815          Bricks are not thinly provisioned

Change-Id: I49a170cdfd77df11fe677e09f4e063d99b159275
BUG: 1212413
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/10588
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
2015-06-02 02:59:34 -07:00
Susant Palai
010da8e41e DHT/permissoin: Let setattr consume stat built from lookup in heal path
setattr call post mkdir(selfheal) ends up using the mode bits
returned by mkdir,which miss the required suid, sgid and sticky bit.
Hence, the fix is to use the mode bits from local->stbuf which was used
to create the missing directories.

Change-Id: I478708c80e28edc6509b784b0ad83952fc074a5b
BUG: 1110262
Signed-off-by: Susant Palai <spalai@redhat.com>
Reviewed-on: http://review.gluster.org/8208
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
2015-06-01 22:53:55 -07:00
Anuradha
f3a340694f features/quota : Do unwind if postbuf is NULL
If postbuf in quota_writev_cbk is NULL directly
an unwind should be done. Trying to dereference
it will lead to a crash.

Change-Id: Idba6ce3cd1bbf37ede96c7f17d01007d6c07057a
BUG: 1221577
Signed-off-by: Anuradha <atalur@redhat.com>
Reviewed-on: http://review.gluster.org/10898
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
2015-06-01 22:25:37 -07:00
Dan Lambright
3f11b8e8ec cluster/dht: maintain start state of rebalance daemon across graph switch.
When we did a graph switch on a rebalance daemon, a second call
to gf_degrag_start() was done. This lead to multiple threads
doing migration. When multiple threads try to move the same
file there can be deadlocks.

Change-Id: I931ca7fe600022f245e3dccaabb1ad004f732c56
BUG: 1226005
Signed-off-by: Dan Lambright <dlambrig@redhat.com>
Reviewed-on: http://review.gluster.org/10977
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
2015-06-01 11:12:38 -07:00
Anoop C S
eeb3565848 features/changelog: Remove inline keyword to avoid warnings (gcc v5.1.1)
When compiled with gcc5, following warnings were displayed
and volume start failed:

changelog-helpers.h:499:1: warning: inline function 'changelog_dispatch_event'
declared but never defined
 changelog_dispatch_event (xlator_t *, changelog_priv_t *, changelog_event_t *);

gf-changelog-journal-handler.c:692:17: warning: 'list_add_tail' is static but
used in inline function 'gf_changelog_queue_journal' which is not static
                 list_add_tail (&entry->list, &jnl_proc->entries);

Fix is to remove the keyword from function prototype and
definitions.

Change-Id: I188b35b7ca087a94d7a48a052b05a6d845e3b74b
BUG: 1226307
Signed-off-by: Anoop C S <achiraya@redhat.com>
Reviewed-on: http://review.gluster.org/11004
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
2015-06-01 01:56:28 -07:00
vmallika
754df15ece quota: retry connecting to quotad on ENOTCONN error
Suppose if there are two volumes vol1 and vol2,
and quota is enabled and limit is set on vol1.
Now if IO is happening on vol1 and quota is enabled/disabled
on vol2, quotad gets restarted and client will receive
ENOTCONN in the IO path of vol1.

This patch will retry connecting to quotad upto 60sec
in a interval of 5sec (12 retries)
If not able to connect with 12 retries, then return ENOTCONN

Change-Id: Ie7f5d108633ec68ba9cc3a6a61d79680485193e8
BUG: 1211220
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/10230
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
2015-05-31 22:29:43 -07:00
vmallika
d9efe535c9 features/quota: prevent statfs frame-loss when an error happens during
ancestry building.

We do quota_build_ancestry in function 'quota_get_limit_dir',
suppose if quota_build_ancestry fails, then we don't have a
frame saved to continue the statfs FOP and client can hang.

Change-Id: I92e25c1510d09444b9d4810afdb6b2a69dcd92c0
BUG: 1178619
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/9380
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2015-05-31 21:45:31 -07:00
Krutika Dhananjay
43d464326b features/shard: Fix issue with readdir(p) fop
Problem:

When readdir(p) is performed on '/' and ".shard" happens to be
the last of the entries read in a given iteration of dht_readdir(p)
(in other words the entry with the highest offset in the dirent list
sorted in ascending order of d_offs), shard xlator would delete this
entry as part of handling the call so as to avoid exposing its presence
to the application. This would cause xlators above (like fuse,
readdir-ahead etc) to wind the next readdirp as part of the same req
at an offset which is (now) the highest d_off (post deletion of .shard)
from the previously unwound list of entries. This offset would be less
than that of ".shard" and therefore cause /.shard to be read once again.
If by any chance this happens to be the only entry until end-of-directory,
shard xlator would delete this entry and unwind with 0 entries, causing the
xlator(s) above to think there is nothing more to readdir and the fop is
complete. This would prevent DHT from gathering entries from the rest of
its subvolumes, causing some entries to disappear.

Fix:

At the level of shard xlator, if ".shard" happens to be the last entry,
make shard xlator wind another readdirp at offset equal to d_off of
".shard". That way, if ".shard" happens to be the only other entry under '/'
until end-of-directory, DHT would receive an op_ret=0. This would enable it
to wind readdir(p) on the rest of its subvols and gather the complete picture.

Also, fixed a bug in shard_lookup_cbk() wherein file_size should be fetched
unconditionally in cbk since it is set unconditionally in the wind path, failing
which, lookup would be unwound with ia_size and ia_blocks only equal to that of
the base file.

Change-Id: I6c2bc770f1bcdad51c273c777ae0b42c88c53f61
BUG: 1222379
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/10809
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
2015-05-31 20:31:57 -07:00
Raghavendra Bhat
37cc99fc3a features/bit-rot-stub: implement mknod fop
With the absence of mknod() fop implementation in bitrot stub,
further operations that trigger versioning resulted in crashes
as they expect the inode context to be valid. Therefore, this
patch implements mknod() following similar simantics to fops
such as create().

Furthermore, bitrot stub test C program is fixed to stop lying
and validate obj versions according to the versioning protocol.

Change-Id: If76f252577445d1851d6c13c7e969e864e2183ef
BUG: 1221914
Original-Author: Raghavendra Bhat <raghavendra@redhat.com>
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-on: http://review.gluster.org/10790
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2015-05-31 08:00:16 -07:00
Kotresh HR
d76e9b8345 featuress/changelog: On snapshot, notify irrespective of failures
During snapshot, changelog barrier is enabled and a
explicit rollover of changelog is initiated. During
rollover of changelog, if any error or changelog is
empty, the notification was not sent to reconfigure
and hence snapshot was failing because of timeout.
This patch addresses it by sending notification
irrespective of failures and sends error if any
back to barrier.

Change-Id: I898af624b44555281a9e43c69066077e0e121c17
BUG: 1225542
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/10951
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
2015-05-31 07:48:19 -07:00
Venky Shankar
457edddbaa features/bitrot: serialize versioning
Current signing interface (fsetxattr()) had couple of issues:

One, a signing request (by bitrot daemon) is denied if the version
against which an object is to be signed is unequal to the current
version of the object (cases where another subsequent modification
increments the version). Such request(s) are rejected with EINVAL
sent back to the signer resulting in a bunch of errors (in logs)
reported by bitrot daemon. Although, the object would be eventaully
signed with the version matching the current version, the "lagging"
request should be correctly handled.

Two, more than one signing request could race against each other
with the object getting signed with a version depending on which
request ended up last in the race. Although harmless to some extent,
such a case could end up marking the object's signature as stale
for infinity (if the object is *never* touched) thereby resulting
in scrubber skipping the object during verification.

This patch fixes these issues by ordering signing request(s) and
fixing version comparison checks at the time of signing.

Change-Id: I9fa83dfa3be664ba4db61d7f2edc408f4bde77dd
BUG: 1221938
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-on: http://review.gluster.org/10832
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2015-05-31 00:20:52 -07:00
Pranith Kumar K
35f7d213fe features/qemu-block: Don't unref root inode
Root inode doesn't participate in ref/unref. Don't do it
in fini as by the time fini is called itable would be destroyed.

BUG: 1226276
Change-Id: I704d0a3c0813cb8f6c3f1f7d613c89aca8f4f9ad
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/11002
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
2015-05-30 05:37:18 -07:00
Xavier Hernandez
90ed7128df cluster/ec: Ignore differences in non locked inodes
When ec combines iatt structures from multiple bricks, it checks
for equality in important fields. This is ok for iatt related to
inodes involved in the operation that have been locked before
starting execution. However some fops return iatt information
from other inodes. For example a rename locks source and destination
parent directories, but it also returns an iatt from the entry
itself.

In these cases we ignore differences in some fields to avoid false
detection of inconsistencies and trigger unnecessary self-heals.

Another issue is solved in this patch that caused that the real
size of the file stored into the inode context was lost during
self-heal.

Change-Id: I8b8eca30b2a6c39c7b9bbd3b3b6ba95228fcc041
BUG: 1225793
Signed-off-by: Xavier Hernandez <xhernandez@datalab.es>
Reviewed-on: http://review.gluster.org/10974
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: NetBSD Build System
2015-05-30 05:35:33 -07:00
Kaleb S. KEITHLEY
8772ca6c55 build: xlators/mgmt/glusterd/src/glusterd-errno.h is not in dist tarball
attempts to build RPMs, e.g. in tree with `make -C extras/LinuxRPM
glusterrpms` or from a dist tarball produced in tree will fail with:

glusterd-locks.c:19:28: fatal error: glusterd-errno.h: No such file
or directory compilation terminated

Change-Id: I365dbcd5b7bc3410f4a7752a05f570e4061461d0
BUG: 1226384
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/11007
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
2015-05-29 20:30:39 -07:00
Niels de Vos
8a9328e37b build: do not #include "config.h" in each file
Instead of including config.h in each file, and have the additional
config.h included from the compiler commandline (-include option).

When a .c file tests for a certain #define, and config.h was not
included, incorrect assumtions were made. With this change, it can not
happen again.

BUG: 1222319
Change-Id: I4f9097b8740b81ecfe8b218d52ca50361f74cb64
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/10808
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
2015-05-29 05:43:17 -07:00
Pranith Kumar K
15a28c2b70 worm: Let lock, zero xattrop calls succeed
Locks can be taken just to inspect the data as well, so allow them.
Xattrops are internal fops so we can allow them as well as longs as
it doesn't change the xattr value, i.e. All-zero xattrop.

Change-Id: Idc06d2043eb472c064db40d811a80058f0bda378
BUG: 1211123
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/10727
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
Tested-by: NetBSD Build System
2015-05-29 04:47:28 -07:00
Sachin Pandit
99eaa1a825 features/quota : Make "quota-deem-statfs" option "on" by default, when quota is enabled
As of now it is expected from user to set deem-statfs to "on" when
quota is enabled. Better to turn it "on" by default when quota is enabled.

Change-Id: I85e0b919b1bdb74ac21e256073eebcb55bcb8e2a
BUG: 1213364
Signed-off-by: Sachin Pandit <spandit@redhat.com>
Reviewed-on: http://review.gluster.org/10299
Tested-by: NetBSD Build System
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
2015-05-29 00:17:34 -07:00