Description of problem: GF_ASSERT (local->fd); if (pause_fop) GF_ASSERT (local->fop_call_continue); ret = afr_prepare_loc (frame, local->fd); if (ret < 0) { //File does not exist we cant open it. ret = 0; goto out; } fd_ctx = afr_fd_ctx_get (local->fd, this); if (!fd_ctx) { ret = -EINVAL; goto unlock; } In the above function call if we cannot get the fd context, then we are going to unlock where we are unlocking the local->fd->lock. But the locking itself is happening later (below piece of code.) LOCK (&local->fd->lock); { if (fd_ctx->up_count < priv->up_count) { need_self_heal = _gf_true; fd_ctx->up_count = priv->up_count; fd_ctx->down_count = priv->down_count; Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
CHANGE: http://review.gluster.com/2658 (cluster/afr: do not unlock without holding the lock on the fd) merged in master by Vijay Bellur (vijay)
Tested with glusterfs-3.3.0qa22. Now it unlock is not happening without holding the lock.