There are certain Kernel versions which do not send individual
Forget operations after they receive "not implemented" for Batch Forget.
One example is "5.4.0-110-generic" on Ubuntu 20.04. I am sure there are
plenty of others.
This leads to inode "leaks". Where reference counts are never decreased
and the inodes were left hanging around long after they are not needed
any more.
The best way to fix that was adding support for batch operations to the
lib. This way all users will be able to benefit from the batching
optimization.
Co-authored-by: Doychin Atanasov <doychin.atanasov@chaosgroup.com>
Read requests can now take vectored responses from the filesystem
implementation and send them to FUSE device via the writev() system call.
This allows file systems to send data without copying it into the
library-provided buffer if the data is already in memory.
Closed-source macfuse 4.x has broken compatibility with osxfuse 3.x:
it passes an additional 64-bit field (flags) after RenameIn regardless
that we don't enable the support for RENAME_SWAP/RENAME_EXCL.
The simplest fix is just to check for the presence of all-zero flags
and strip them when they're present.
Co-authored-by: Vitaliy Filippov <vitalif@yourcmc.ru>
* Bump protocol version to min 7.28, max 7.31
* Increase read/write buffer size to 1MiB
* Add new fields to initOp
* Set FUSE_MAX_PAGES flag for init
* Lower min minor version to 19 for osxfuse
* Fix linux WriteSize test
Expose PID as metadata in CreateFile, OpenFile and FlushFile operations
This will help us with kahing/goofys#273
Co-authored-by: Sai Teja Suram <pratap130492@gmail.com>
Co-authored-by: Sai Teja Suram <pts@avah.dev>
previously, this will fail if /mnt/file doesn't have an xattr:
```
listxattr("/mnt/file", 0x7fe8b3686830, 256) = -1 EIO (Input/output error)
```
We should be returning the actual size only if the input size is
zero. Related issue is if the filesystem returns ERANGE, we should
propagate that error instead of returning the actual size.
Replaced go-xattr usage with x/sys/unix so we can test this.
Tools like du and ls -l use this value to calculate the space used.
Force block size to 512 bytes for simplicity and compatibility with
Mac OS X which uses an older FUSE.