summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavan Sondur <pavan@gluster.com>2010-05-21 01:19:33 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-05-21 00:32:31 -0700
commit8e455dd63ede774f99b0d5c5e5832c0550d00dcf (patch)
tree229884f066d10bbce8184c0c2aba5e5e1946e13a
parentc0763ba1579fbad705cd29e256fb083376fb0e07 (diff)
cluster/afr: Check before accessing xattrs in data self heal.
The lookup xattrs might be null, because a lookup might not have been issued during self heal, especially if only data self heal is required. Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 815 (quick-read and replicate self-heal interaction result in empty reads) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=815
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-data.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c
index 265628d2e08..225dd07b881 100644
--- a/xlators/cluster/afr/src/afr-self-heal-data.c
+++ b/xlators/cluster/afr/src/afr-self-heal-data.c
@@ -747,7 +747,8 @@ afr_sh_data_fix (call_frame_t *frame, xlator_t *this)
*/
dict_unref (orig_local->cont.lookup.xattr);
- orig_local->cont.lookup.xattr = dict_ref (orig_local->cont.lookup.xattrs[sh->source]);
+ if (orig_local->cont.lookup.xattrs)
+ orig_local->cont.lookup.xattr = dict_ref (orig_local->cont.lookup.xattrs[sh->source]);
if (sh->background) {
sh->unwind (sh->orig_frame, this);