diff options
author | Bernd Schubert <bschubert@ddn.com> | 2025-03-07 22:43:50 +0100 |
---|---|---|
committer | Bernd Schubert <bernd@bsbernd.com> | 2025-04-15 00:50:26 +0200 |
commit | e65395521bae162b72f038f02ccbe5686f7bf88c (patch) | |
tree | 3d746101bad6ff262ee9b4884b435937151d6096 /lib/fuse_lowlevel.c | |
parent | 15bb63bbebc7bd11871f60e9c535035e158eb065 (diff) | |
download | libfuse-e65395521bae162b72f038f02ccbe5686f7bf88c.tar.gz |
fuse_session_receive_buf: Fix the pipe buf size
This fixes dynamic buffer allocation in commit
0e0f43b79b9b ("Reallocate fuse_session buffer...")
I noticed that when I increased the default fuse buf size as
possible in recent kernels.
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
Diffstat (limited to 'lib/fuse_lowlevel.c')
-rw-r--r-- | lib/fuse_lowlevel.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index c22b4a2..7df3c7a 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -3026,11 +3026,14 @@ static int _fuse_session_receive_buf(struct fuse_session *se, { int err; ssize_t res; - size_t bufsize = se->bufsize; + size_t bufsize; #ifdef HAVE_SPLICE struct fuse_ll_pipe *llp; struct fuse_buf tmpbuf; +pipe_retry: + bufsize = se->bufsize; + if (se->conn.proto_minor < 14 || !(se->conn.want_ext & FUSE_CAP_SPLICE_READ)) goto fallback; @@ -3075,6 +3078,13 @@ static int _fuse_session_receive_buf(struct fuse_session *se, fuse_session_exit(se); return 0; } + + /* FUSE_INIT might have increased the required bufsize */ + if (err == EINVAL && bufsize < se->bufsize) { + fuse_ll_clear_pipe(se); + goto pipe_retry; + } + if (err != EINTR && err != EAGAIN) perror("fuse: splice from device"); return -err; |