diff options
author | Bernd Schubert <bschubert@ddn.com> | 2025-04-07 11:50:19 +0200 |
---|---|---|
committer | Bernd Schubert <bernd@bsbernd.com> | 2025-04-07 15:32:04 +0200 |
commit | 12507408c311601b9e933645b10d8f801f32452c (patch) | |
tree | 160278ecc08fe14fec0ec3c87487bac64852d24f /example | |
parent | ead0a13d57dcbc5ac7b5396722a61cc99cd0c9dc (diff) | |
download | libfuse-12507408c311601b9e933645b10d8f801f32452c.tar.gz |
fuse_lowlevel: Set bufsize if HAVE_SPLICE is not define and avoid race
These are several buf size fixes
1) Set bufsize when HAVE_SPLICE is not defined. Addresses
https://github.com/libfuse/libfuse/issues/1184
2) Check in the read retry condition for bufsize, i.e. the value
passed to read and not for the buf->mem_size. Using buf->mem_size
can be startup racy. Additionally we now also set bufsize on
allocation to avoid these races.
3) Allocation and value assigned needs to follow the pattern
bufsize = se->bufsize;
buf_alloc(bufsize, internal)
buf->mem_size = bufsize;
I.e. bufsize has to be retrieved first, as se->bufsize might
change at anytime - the value used for allocation and
must not differ from the value actually used.
This also tries to set large sizes in passthrough_hp, to catch
issues in xfstests - though requires to set
/proc/sys/fs/fuse/max_pages_limit
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
Diffstat (limited to 'example')
-rw-r--r-- | example/passthrough_hp.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/example/passthrough_hp.cc b/example/passthrough_hp.cc index 1c8db6c..8b5214c 100644 --- a/example/passthrough_hp.cc +++ b/example/passthrough_hp.cc @@ -228,6 +228,9 @@ static void sfs_init(void *userdata, fuse_conn_info *conn) { /* Disable the receiving and processing of FUSE_INTERRUPT requests */ conn->no_interrupt = 1; + + /* Try a large IO by default */ + conn->max_write = 4 * 1024 * 1024; } |