41 Commits
Author SHA1 Message Date
Nayana BidariandgVisor bot 1ebf17e9d9 Fix S/R support for fuse structs.
Add S/R support which was missing for a few structs in fuse, message queue and
tun packages.

PiperOrigin-RevId: 605139914
2024-02-07 17:03:14 -08:00
Andrei Vagin 5f4abad306 Fix a few typos
It is an idea of running codespell as part of our presubmit checks.
Before enabling it for new changes, let's fix what it has found.

Signed-off-by: Andrei Vagin <avagin@gmail.com>
2023-10-25 12:13:42 -07:00
Lucas ManningandgVisor bot 6c24ab8dd8 Issue FUSE_FLUSH request during file close.
PiperOrigin-RevId: 571178563
2023-10-05 17:27:49 -07:00
Ayush RanjanandgVisor bot 8675708cb8 Handle arbitrarily large Fuse Dirent Namelen.
If FUSEDirent.Namelen is larger than the remaining payload size, then the
dirent is probably invalid. We should skip it.

PiperOrigin-RevId: 566678679
2023-09-19 10:48:35 -07:00
Lucas ManningandgVisor bot a66612ffc3 Enable write and fallocate tests for FUSE.
This change also stubs out some methods that will be needed to
implement mmap.

PiperOrigin-RevId: 509298123
2023-02-13 12:17:57 -08:00
Lucas ManningandgVisor bot d4843e167a Enable the stat_times and truncate test for FUSE.
PiperOrigin-RevId: 507534117
2023-02-06 11:24:44 -08:00
Lucas ManningandgVisor bot fc52a6d9cc Give FUSE hard link capabilities and enable the link syscall test.
PiperOrigin-RevId: 507001947
2023-02-03 15:00:04 -08:00
Lucas ManningandgVisor bot 298b5f3612 Refactor FUSE inode implementation.
This change replaces the FUSE inode implementations with a custom
inode type that implementsthe kernfs.Inode interface. It also cleans
up some of the attribute related functions and gets the open_test to
pass.

PiperOrigin-RevId: 506465698
2023-02-01 17:20:22 -08:00
Lucas ManningandgVisor bot 492f4c95c9 Clean up FUSE device methods.
Most of this is just style cleanup. There some comments that are not
really necessary (describing what, not why), control flow that
is more complex than is necessary, and redefinitions of common constant
values.

In the case of writeLocked, using DropFirst() is actually broken when reading
from a pipe, so that change is functional.

PiperOrigin-RevId: 504608319
2023-01-25 11:04:00 -08:00
gVisor bot 70fba80730 Merge pull request #6937 from YaroslavLitvinov:yaro/fix-fuse
PiperOrigin-RevId: 426223561
2022-02-03 13:24:54 -08:00
Yaroslav Litvinov b7ccfa5084 Fixes #7086,#6964,#3413,#7001.
Also adds fuse fsync, rename, flock support.
2022-01-27 13:07:42 +02:00
Rahat MahmoodandgVisor bot 0417b99c16 Replace StubMarshallable with go_marshal's marshal dynamic generator.
FUSE introduced StubMarshallable to avoid boilerplate around types
that were either marshalled in one direction, or were dynamically
sized. The marshal dynamic generator can deal with these cases with a
small bit of stubbing per type.

This also allows FUSE types to be treated as full marshal.Marshallable
types, addressing gVisor.dev/issue/3698.

Closes #3698.

PiperOrigin-RevId: 410335216
2021-11-16 13:31:29 -08:00
Rahat MahmoodandgVisor bot 8650614c32 Shift buffer correctly when unmarshalling FUSE dirents.
PiperOrigin-RevId: 409547679
2021-11-12 17:38:54 -08:00
Ayush RanjanandgVisor bot ce4f4283ba Make {Un}Marshal{Bytes/Unsafe} return remaining buffer.
Change marshal.Marshallable method signatures to return the remaining buffer.
This makes it easier to implement these method manually. Without this, we would
have to manually do buffer shifting which is error prone.

tools/go_marshal/test:benchmark test does not show change in performance.
Additionally fixed some marshalling bugs in fsimpl/fuse.

Updated multiple callpoints to get rid of redundant slice indexing work and
simplified code using this new signature.

Updates #6450

PiperOrigin-RevId: 407857019
2021-11-05 10:43:49 -07:00
Adin ScannellandgVisor bot 4cba3904f4 Remove existing nogo exceptions.
PiperOrigin-RevId: 347047550
2020-12-11 12:06:49 -08:00
Andrei Vagin c6e749fb32 fs/fuse: Move the 'marshal' and 'primitive' packages to the 'pkg' directory. 2020-09-16 12:19:30 -07:00
Boyuan HeandAndrei Vagin 8ab32686e2 fuse_open: add padding to open out request 2020-09-16 12:19:30 -07:00
Boyuan HeandAndrei Vagin 2051260e82 Implement FUSE_UNLINK
Fixes #3696
2020-09-16 12:19:30 -07:00
Craig ChiandAndrei Vagin 70cfea2377 Fix comments of TODO issues. 2020-09-16 12:19:30 -07:00
Craig ChiandAndrei Vagin 2fbbe3b768 Add comments for exported attributes 2020-09-16 12:19:30 -07:00
Craig ChiandAndrei Vagin bf8efe8cdf Implement FUSE_SETATTR
This commit implements FUSE_SETATTR command. When a system call modifies
the metadata of a regular file or a folder by chown(2), chmod(2),
truncate(2), utime(2), or utimes(2), they should be translated to
corresponding FUSE_SETATTR command and sent to the FUSE server.

Fixes #3332
2020-09-16 12:19:30 -07:00
Craig ChiandAndrei Vagin 4181e8c974 Add fh support for revise attr and fstat(2) test
According to Linux 4.4's FUSE behavior, the flags and fh attributes in
FUSE_GETATTR are only used in read, write, and lseek. fstat(2) doesn't
use them either. Add tests to ensure the requests sent from FUSE module
are consistent with Linux's.

Updates #3655
2020-09-16 12:19:30 -07:00
Jinmou LiandAndrei Vagin 98faed55e6 Implement FUSE_WRITE
This commit adds basic write(2) support for FUSE.
2020-09-16 12:19:30 -07:00
Craig ChiandAndrei Vagin 18f1e1c91b Implement FUSE_CREATE
FUSE_CREATE is called when issuing creat(2) or open(2) with O_CREAT. It
creates a new file on the FUSE filesystem.

Fixes #3825
2020-09-16 12:19:30 -07:00
Jinmou LiandAndrei Vagin e91c026672 Downgrade FUSE minor version support and clarify comments 2020-09-16 12:19:30 -07:00