rem: pthread_mutex_lock(&lock); chunk_put(chunk); pthread_mutex_unlock(&lock);
add: chunk_put_locked(chunk);
context: static void sshfs_read_end(struct request *req){    struct read_chunk *chunk = (struct read_chunk *) req->data;    if (req->replied) {        chunk->res = -EPROTO;        if (req->reply_type == SSH_FXP_STATUS) {            uint32_t serr;            if (buf_get_uint32(&req->reply, &serr) != -1) {                if (serr == SSH_FX_EOF)                    chunk->res = 0;            }        } else if (req->reply_type == SSH_FXP_DATA) {            uint32_t retsize;            if (buf_get_uint32(&req->reply, &retsize) != -1) {                if (retsize > chunk->size)                    fprintf(stderr, "long read\n");                else {                    chunk->res = retsize;                    chunk->data = req->reply;                    buf_init(&req->reply, 0);                }            }        } else            fprintf(stderr, "protocol error\n");    } else        chunk->res = -EIO;    sem_post(&chunk->ready);    pthread_mutex_lock(&lock);    chunk_put(chunk);    pthread_mutex_unlock(&lock);}