diff options
Diffstat (limited to 'xlators/cluster/afr/src/afr-transaction.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-transaction.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c index be4a914d4a6..265d93b6189 100644 --- a/xlators/cluster/afr/src/afr-transaction.c +++ b/xlators/cluster/afr/src/afr-transaction.c @@ -1452,21 +1452,25 @@ afr_transaction (call_frame_t *frame, xlator_t *this, afr_transaction_type type) afr_local_t * local = NULL; afr_private_t * priv = NULL; fd_t *fd = NULL; + int ret = -1; local = frame->local; priv = this->private; - afr_transaction_local_init (local, this); + if (local->fd && priv->eager_lock && + local->transaction.type == AFR_DATA_TRANSACTION) + afr_set_lk_owner (frame, this, local->fd); + else + afr_set_lk_owner (frame, this, frame->root); + + ret = afr_transaction_local_init (local, this); + if (ret < 0) { + goto out; + } local->transaction.resume = afr_transaction_resume; local->transaction.type = type; - if (local->fd && priv->eager_lock && - local->transaction.type == AFR_DATA_TRANSACTION) - afr_set_lk_owner (frame, this, local->fd); - else - afr_set_lk_owner (frame, this, frame->root); - if (_does_transaction_conflict_with_delayed_post_op (frame) && local->loc.inode) { fd = fd_lookup (local->loc.inode, frame->root->pid); @@ -1481,6 +1485,7 @@ afr_transaction (call_frame_t *frame, xlator_t *this, afr_transaction_type type) } else { afr_lock (frame, this); } - - return 0; + ret = 0; +out: + return ret; } |