Allow to have page aligned writes
authorBernd Schubert <bschubert@ddn.com>
Mon, 16 Dec 2024 22:37:29 +0000 (23:37 +0100)
committerBernd Schubert <bernd.schubert@fastmail.fm>
Wed, 18 Dec 2024 08:28:18 +0000 (09:28 +0100)
commit752b59ac087658adb50d50a492d228d53081d195
treeb0fa494d3a133a110fc20513ba74dee73e5031d8
parentd0b0fc27fdfc78a13a07c1ea04b728bebc8c6e87
Allow to have page aligned writes

Read/writes IOs should be page aligned as fuse server
might need to copy data to another buffer otherwise in
order to fulfill network or device storage requirements.

Simple reproducer is example/passthrough*
and opening a file with O_DIRECT - without this change
writing to that file failed with -EINVAL if the underlying
file system was using ext4 (for passthrough_hp the
'passthrough' feature has to be disabled).

The mis-alignment from fuse kernel is not ideal, but we can handle
it by allocation one page more than needed and then using a buffer
that is set up to compensate for kernel misalignment.

This also only set se->buf_reallocable to true when called
by a libfuse internal caller - we do not know what
external callers are doing with the buffer - update to
commit 0e0f43b79b9b
ChangeLog.rst
lib/fuse.c
lib/fuse_i.h
lib/fuse_loop.c
lib/fuse_loop_mt.c
lib/fuse_lowlevel.c
lib/util.h