aboutsummaryrefslogtreecommitdiff
path: root/lib/fuse_lowlevel.c
diff options
context:
space:
mode:
authorGravatar Nikolaus Rath <Nikolaus@rath.org>2016-10-03 20:23:42 -0700
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2016-10-03 23:01:46 -0700
commite572cfbd3490add057b867c29d37da51ee8217e5 (patch)
tree8e5a442ab2e34ceea050b7d6adbbe7c5c7ce9d25 /lib/fuse_lowlevel.c
parent292fb198f108f46458008066827da965be8a4334 (diff)
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.
Diffstat (limited to 'lib/fuse_lowlevel.c')
-rw-r--r--lib/fuse_lowlevel.c9
1 files changed, 4 insertions, 5 deletions
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;
}