summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-09-09 02:43:10 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-09 01:47:41 -0700
commit9ed068a03e6f07e7f0bb69b32c08cd251f369ce8 (patch)
tree3105ddcb9d397bddfa4c99e9b56db62d005b945a
parent576d7030430c7a2e68c8454b40ebaa83853f0ba2 (diff)
stripe: fixed create issues after gfid changes
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1581 (stripe create is broken) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1581
-rw-r--r--xlators/cluster/stripe/src/stripe.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c
index 5ec3d6681..a9f620389 100644
--- a/xlators/cluster/stripe/src/stripe.c
+++ b/xlators/cluster/stripe/src/stripe.c
@@ -149,6 +149,8 @@ stripe_entry_self_heal (call_frame_t *frame, xlator_t *this,
call_frame_t *rframe = NULL;
stripe_local_t *rlocal = NULL;
stripe_private_t *priv = NULL;
+ dict_t *dict = NULL;
+ int ret = 0;
if (!local || !this || !frame) {
gf_log ("stripe", GF_LOG_DEBUG, "possible NULL deref");
@@ -175,6 +177,15 @@ stripe_entry_self_heal (call_frame_t *frame, xlator_t *this,
loc_copy (&rlocal->loc, &local->loc);
memcpy (&rlocal->stbuf, &local->stbuf, sizeof (struct iatt));
+ dict = dict_new ();
+ if (!dict)
+ goto out;
+
+ ret = dict_set_static_bin (dict, "gfid-req", local->stbuf.ia_gfid, 16);
+ if (ret)
+ gf_log (this->name, GF_LOG_WARNING,
+ "failed to set gfid-req");
+
while (trav) {
if (IA_ISREG (local->stbuf.ia_type)) {
STACK_WIND (rframe, stripe_sh_make_entry_cbk,
@@ -182,19 +193,22 @@ stripe_entry_self_heal (call_frame_t *frame, xlator_t *this,
&local->loc,
st_mode_from_ia (local->stbuf.ia_prot,
local->stbuf.ia_type), 0,
- NULL);
+ dict);
}
if (IA_ISDIR (local->stbuf.ia_type)) {
STACK_WIND (rframe, stripe_sh_make_entry_cbk,
trav->xlator, trav->xlator->fops->mkdir,
&local->loc, st_mode_from_ia (local->stbuf.ia_prot,
local->stbuf.ia_type),
- NULL);
+ dict);
}
trav = trav->next;
}
out:
+ if (dict)
+ dict_unref (dict);
+
return 0;
}
@@ -1365,7 +1379,7 @@ stripe_mknod_ifreg_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
"trusted.%s.stripe-index", this->name);
local->call_count = priv->child_count;
-
+ memcpy (local->loc.inode->gfid, local->stbuf.ia_gfid, 16);
for (i = 0; i < priv->child_count; i++) {
dict = get_new_dict ();
if (!dict) {
@@ -1989,7 +2003,7 @@ stripe_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
"trusted.%s.stripe-index", this->name);
local->call_count = priv->child_count;
-
+ memcpy (local->loc.inode->gfid, local->stbuf.ia_gfid, 16);
for (i = 0; i < priv->child_count; i++) {
dict = get_new_dict ();
if (!dict) {