cluster/afr: Set pargfid when missing

client asserts for missing pargfid in case of unlink. So
Afr needs to make sure it is present in that fop.

Change-Id: Iea0ad65e1e7254c8df412942c52d5870e853aa51
BUG: 769055
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2495
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
This commit is contained in:
Pranith Kumar K 2011-12-20 10:05:12 +05:30 committed by Vijay Bellur
parent 5ccbfdd87b
commit d7d9f3d400
3 changed files with 14 additions and 4 deletions

View File

@ -1385,6 +1385,7 @@ afr_sh_remove_entry_cbk (call_frame_t *frame, xlator_t *this, int child,
void
afr_sh_call_entry_expunge_remove (call_frame_t *frame, xlator_t *this,
int child_index, struct iatt *buf,
struct iatt *parentbuf,
afr_expunge_done_cbk_t expunge_done)
{
call_frame_t *expunge_frame = NULL;
@ -1408,7 +1409,8 @@ afr_sh_call_entry_expunge_remove (call_frame_t *frame, xlator_t *this,
expunge_sh->sh_frame = frame;
loc_copy (&expunge_local->loc, &local->loc);
sh->expunge_done = expunge_done;
afr_sh_entry_expunge_remove (expunge_frame, this, child_index, buf);
afr_sh_entry_expunge_remove (expunge_frame, this, child_index, buf,
parentbuf);
return;
out:
gf_log (this->name, GF_LOG_ERROR, "Expunge of %s failed, reason: %s",
@ -1540,6 +1542,7 @@ afr_sh_purge_entry_common (call_frame_t *frame, xlator_t *this,
"on %d", local->loc.path, i);
afr_sh_call_entry_expunge_remove (frame, this,
(long) i, &sh->buf[i],
&sh->parentbufs[i],
afr_sh_remove_entry_cbk);
}
out:

View File

@ -97,7 +97,8 @@ afr_sh_common_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc,
int32_t flags);
int
afr_sh_entry_expunge_remove (call_frame_t *expunge_frame, xlator_t *this,
int active_src, struct iatt *buf);
int active_src, struct iatt *buf,
struct iatt *parentbuf);
int
afr_sh_entrylk (call_frame_t *frame, xlator_t *this, loc_t *loc,
char *base_name, afr_lock_cbk_t lock_cbk);

View File

@ -475,7 +475,8 @@ afr_sh_entry_expunge_rmdir (call_frame_t *expunge_frame, xlator_t *this,
int
afr_sh_entry_expunge_remove (call_frame_t *expunge_frame, xlator_t *this,
int active_src, struct iatt *buf)
int active_src, struct iatt *buf,
struct iatt *parentbuf)
{
afr_private_t *priv = NULL;
afr_local_t *expunge_local = NULL;
@ -484,6 +485,7 @@ afr_sh_entry_expunge_remove (call_frame_t *expunge_frame, xlator_t *this,
int type = 0;
afr_self_heal_t *sh = NULL;
afr_local_t *local = NULL;
loc_t *loc = NULL;
priv = this->private;
expunge_local = expunge_frame->local;
@ -491,8 +493,11 @@ afr_sh_entry_expunge_remove (call_frame_t *expunge_frame, xlator_t *this,
frame = expunge_sh->sh_frame;
local = frame->local;
sh = &local->self_heal;
loc = &expunge_local->loc;
type = buf->ia_type;
if (loc->parent && uuid_is_null (loc->parent->gfid))
uuid_copy (loc->pargfid, parentbuf->ia_gfid);
switch (type) {
case IA_IFSOCK:
@ -556,7 +561,8 @@ afr_sh_entry_expunge_lookup_cbk (call_frame_t *expunge_frame, void *cookie,
goto out;
}
afr_sh_entry_expunge_remove (expunge_frame, this, active_src, buf);
afr_sh_entry_expunge_remove (expunge_frame, this, active_src, buf,
postparent);
return 0;
out: