Page MenuHomeFreeBSD

fusefs: implement VOP_ALLOCATE
ClosedPublic

Authored by asomers on Dec 11 2021, 8:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 25 2024, 3:01 AM
Unknown Object (File)
Mar 7 2024, 4:47 PM
Unknown Object (File)
Jan 14 2024, 3:10 PM
Unknown Object (File)
Dec 25 2023, 6:52 PM
Unknown Object (File)
Dec 20 2023, 2:53 AM
Unknown Object (File)
Dec 13 2023, 12:01 PM
Unknown Object (File)
Oct 31 2023, 9:11 AM
Unknown Object (File)
Sep 19 2023, 8:38 PM
Subscribers

Details

Summary

Now posix_fallocate will be correctly forwarded to fuse file system
servers, for those that support it.

MFC after: 2 weeks

Test Plan

Test cases added

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I don't know if fuse does this by default, but if IO_SYNC is
specified in the flags argument to VOP_ALLOCATE(), the
allocation must be committed to stable storage (disk or ???)
before VOP_ALLOCATE() returns.

Just fyi, in case you were not aware of it.

I don't know if fuse does this by default, but if IO_SYNC is
specified in the flags argument to VOP_ALLOCATE(), the
allocation must be committed to stable storage (disk or ???)
before VOP_ALLOCATE() returns.

Just fyi, in case you were not aware of it.

I was not aware of that. It looks like the NFS server will set IO_SYNC? Is there any other way call it with that flag set? FUSE has no equivalent, but I could follow the FUSE_ALLOCATE with a call to FUSE_FSYNC.

I am not aware of any other way that IO_SYNC can get
set, except for the NFSv4.2 server.
Doing FUSE_FSYNC after FUSE_ALLCOATE for that
case sounds fine to me.

I am not aware of any other way that IO_SYNC can get
set, except for the NFSv4.2 server.
Doing FUSE_FSYNC after FUSE_ALLCOATE for that
case sounds fine to me.

This is going to take me awhile. I can't use my usual test suite, so I need to test with an actual fuse file system exported over NFS. But to do that, I first need to write a FUSE file system that works with NFS 4.2 and posix_fallocate.

Sure, I don't see this as anywhere near urgent.
1 - Few use NFSv4.2 (as you noted).
2 - The VOP_FSYNC() only matters if the server

crashes just after doing the VOP_ALLOCATE()
and loses the changes.

Oh, and because this (plus the cred argument) are not in stable/13,
the FreeBSD NFSv4.2 Allocate is broken in FreeBSD 13. I should
probably do a commit to completely disable it instead of only
having it disabled by default.

LGTM, especially since we were not handling the case.

This revision is now accepted and ready to land.Jan 1 2022, 12:41 AM
This revision was automatically updated to reflect the committed changes.