From e572cfbd3490add057b867c29d37da51ee8217e5 Mon Sep 17 00:00:00 2001 From: Nikolaus Rath Date: Mon, 3 Oct 2016 20:23:42 -0700 Subject: fuse_lowlevel_notify_poll(): use master channel In theory, a poll handle could hang around much longer than the worker thread that creates it. Furthermore, the thread that created the pollhandle is no more likely to call fuse_lowlevel_notify_poll() than any other thread. In theory, this would have kept the channel alive for much longer than necessary. In practice, there seems to have been a bug that prevented this - and instead allowed the channel to be destroyed while there was still a pollhandle referring to it. Instead of fixing this by calling fuse_chan_get() and fuse_chan_put() in do_poll() and fuse_pollhandle_destroy(), we simply transmit poll notifications over the master channel now. --- lib/fuse_lowlevel.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/fuse_lowlevel.c') diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index 82cbe06..d7b1fd1 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -44,8 +44,7 @@ struct fuse_pollhandle { uint64_t kh; - struct fuse_chan *ch; - struct fuse_ll *f; + struct fuse_session *se; }; static size_t pagesize; @@ -1794,8 +1793,7 @@ static void do_poll(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) return; } ph->kh = arg->kh; - ph->ch = req->ch; - ph->f = req->f; + ph->se = req->se; } req->f->op.poll(req, nodeid, &fi, ph); @@ -2110,7 +2108,8 @@ int fuse_lowlevel_notify_poll(struct fuse_pollhandle *ph) iov[1].iov_base = &outarg; iov[1].iov_len = sizeof(outarg); - return send_notify_iov(ph->f, ph->ch, FUSE_NOTIFY_POLL, iov, 2); + return send_notify_iov(ph->se->f, ph->se->ch, + FUSE_NOTIFY_POLL, iov, 2); } else { return 0; } -- cgit v1.2.3