diff options
author | Vikas Gorur <vikas@gluster.com> | 2009-10-20 01:36:35 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-10-20 00:28:12 -0700 |
commit | 121a781c1dd2d46f01bc6e9e30e1efc6b676a07a (patch) | |
tree | 08972d83c31becdaa1f4299243bc4a9336988db9 /xlators | |
parent | fbaea55d731ea9891c1c6ae08dea6b7765e7ad11 (diff) |
cluster/afr: Attempt to set fd ctx in create only if the call has succeeded.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 325 (crash in afr_fd_ctx_set)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=325
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/cluster/afr/src/afr-dir-write.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/xlators/cluster/afr/src/afr-dir-write.c b/xlators/cluster/afr/src/afr-dir-write.c index 7b33d336f..c30ccbf74 100644 --- a/xlators/cluster/afr/src/afr-dir-write.c +++ b/xlators/cluster/afr/src/afr-dir-write.c @@ -135,19 +135,18 @@ afr_create_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (afr_fop_failed (op_ret, op_errno)) afr_transaction_fop_failed (frame, this, child_index); - ret = afr_fd_ctx_set (this, fd); + if (op_ret != -1) { + local->op_ret = op_ret; - if (ret < 0) { - gf_log (this->name, GF_LOG_DEBUG, - "could not set ctx on fd=%p", fd); + ret = afr_fd_ctx_set (this, fd); - local->op_ret = -1; - local->op_errno = -ret; - } + if (ret < 0) { + gf_log (this->name, GF_LOG_DEBUG, + "could not set ctx on fd=%p", fd); - - if (op_ret != -1) { - local->op_ret = op_ret; + local->op_ret = -1; + local->op_errno = -ret; + } if (local->success_count == 0) { local->cont.create.buf = *buf; |