diff --git a/src/Protocols/9P/9p_lock.c b/src/Protocols/9P/9p_lock.c index 70eb98494b..c10e50a484 100644 --- a/src/Protocols/9P/9p_lock.c +++ b/src/Protocols/9P/9p_lock.c @@ -164,10 +164,11 @@ int _9p_lock(struct _9p_request_data *req9p, u32 *plenout, char *preply) status = _9P_LOCK_GRACE; break; } - + PTHREAD_RWLOCK_wrlock(&pfid->pentry->state_hdl->state_lock); state_status = state_lock(pfid->pentry, powner, pfid->state, STATE_NON_BLOCKING, NULL, &lock, &holder, &conflict); + PTHREAD_RWLOCK_unlock(&pfid->pentry->state_hdl->state_lock); if (state_status == STATE_SUCCESS) status = _9P_LOCK_SUCCESS;