libfuse: get ref for req
authorMiklos Szeredi <mszeredi@suse.cz>
Mon, 18 May 2015 14:55:20 +0000 (16:55 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Mon, 18 May 2015 14:55:20 +0000 (16:55 +0200)
While the request lives don't free the channel associated with the request,
the answer will need to be written on the channel.

lib/fuse_lowlevel.c

index e70733ac799b41126442945adf65e03140933010..8433e0a161e298753afe9add71acd106e3fe43b2 100755 (executable)
@@ -134,6 +134,8 @@ void fuse_free_req(fuse_req_t req)
        req->u.ni.data = NULL;
        list_del_req(req);
        ctr = --req->ctr;
+       fuse_chan_put(req->ch);
+       req->ch = NULL;
        pthread_mutex_unlock(&f->lock);
        if (!ctr)
                destroy_req(req);
@@ -2538,7 +2540,7 @@ void fuse_session_process_buf(struct fuse_session *se,
        req->ctx.uid = in->uid;
        req->ctx.gid = in->gid;
        req->ctx.pid = in->pid;
-       req->ch = ch;
+       req->ch = fuse_chan_get(ch);
 
        err = EIO;
        if (!f->got_init) {