diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2016-05-31 14:49:33 +0530 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2016-06-01 06:28:14 -0700 |
commit | 46c0b791d528bebf1168972a34f7483bfe683ba3 (patch) | |
tree | 6f3932b742ebbeb7857dd7be1a8622a9458dfd86 /xlators/cluster/afr/src/afr-inode-write.c | |
parent | cb8f5e01f639cb6e8715b33bb725210cb0493887 (diff) |
cluster/afr: Unwind with xdata in inode-write fops
When there is a failure afr was not unwinding xdata to xlators above.
xdata need not be NULL on failures. So it is important to send it
to parent xlators.
Change-Id: Ic36aac10a79fa91121961932dd1920cb1c2c3a4c
BUG: 1340623
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/14567
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-inode-write.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-inode-write.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c index 47320ce9412..76526bcf177 100644 --- a/xlators/cluster/afr/src/afr-inode-write.c +++ b/xlators/cluster/afr/src/afr-inode-write.c @@ -79,16 +79,17 @@ __afr_inode_write_finalize (call_frame_t *frame, xlator_t *this) if (local->inode) { if (local->transaction.type == AFR_METADATA_TRANSACTION) - read_subvol = afr_metadata_subvol_get (local->inode, this, - NULL, NULL, - &args); + read_subvol = afr_metadata_subvol_get (local->inode, + this, NULL, local->readable, NULL, &args); else read_subvol = afr_data_subvol_get (local->inode, this, - NULL, NULL, NULL, &args); + NULL, local->readable, NULL, &args); } local->op_ret = -1; local->op_errno = afr_final_errno (local, priv); + afr_pick_error_xdata (local, priv, local->inode, local->readable, NULL, + NULL); for (i = 0; i < priv->child_count; i++) { if (!local->replies[i].valid) @@ -156,6 +157,8 @@ __afr_inode_write_fill (call_frame_t *frame, xlator_t *this, int child_index, local->replies[child_index].op_ret = op_ret; local->replies[child_index].op_errno = op_errno; + if (xdata) + local->replies[child_index].xdata = dict_ref (xdata); if (op_ret >= 0) { if (prebuf) @@ -164,8 +167,6 @@ __afr_inode_write_fill (call_frame_t *frame, xlator_t *this, int child_index, local->replies[child_index].poststat = *postbuf; if (xattr) local->replies[child_index].xattr = dict_ref (xattr); - if (xdata) - local->replies[child_index].xdata = dict_ref (xdata); } else { afr_transaction_fop_failed (frame, this, child_index); } |