summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-06-05crossbuild.bash: also build for Apple M1Jakob Unterwurzacher
2021-06-05syscallcompat: drop obsolete wrappersJakob Unterwurzacher
These are now available cross-platform in the unix package.
2021-06-05Update README for v2.0v2.0Jakob Unterwurzacher
2021-06-05doc: add benchmark for v2.0, reformat tableJakob Unterwurzacher
2021-06-04Add contrib/atomicrenameJakob Unterwurzacher
$ ./contrib/atomicrename/atomicrename -h atomicrename creates 100 "src" files in the current directory, renames them in random order over a single "dst" file while reading the "dst" file concurrently in a loop. Progress and errors are reported as they occour in addition to a summary printed at the end. cifs and fuse filesystems are known to fail, local filesystems and nfs seem ok. See https://github.com/hanwen/go-fuse/issues/398 for background info.
2021-06-03fido2: quote argument strings in debug outputJakob Unterwurzacher
Tested using gocryptfs -init -debug -fido2 "hello world" cipherdir Output before: callFidoCommand: executing "/usr/bin/fido2-cred" with args [fido2-cred -M -h -v hello world] After: callFidoCommand: executing "/usr/bin/fido2-cred" with args ["fido2-cred" "-M" "-h" "-v" "hello world"] Related: https://github.com/rfjakob/gocryptfs/issues/571
2021-06-02fsck: mark temporary mount read-onlyJakob Unterwurzacher
We don't write during fsck, but somebody else might try to.
2021-06-02fsck: clean up temporary mountpointJakob Unterwurzacher
We used to leave directories like /tmp/gocryptfs.fsck.104431245 behind. Let's clean up after ourselves.
2021-06-02fusefrontend: run acl Setxattr in user contextJakob Unterwurzacher
The result of setting an acl depends on who runs the operation! Fixes fuse-xfstests generic/375 (see https://github.com/rfjakob/fuse-xfstests/wiki/results_2021-05-19)
2021-06-02fusefrontend: catch ReadAt integer overflowJakob Unterwurzacher
Discovered by xfstests generic/564 . Failure was: generic/564 - output mismatch (see /opt/fuse-xfstests/results//generic/564.out.bad) --- tests/generic/564.out 2021-05-08 21:11:05.307395966 +0200 +++ /opt/fuse-xfstests/results//generic/564.out.bad 2021-05-19 19:01:16.912888879 +0200 @@ -31,7 +31,7 @@ source range beyond 8TiB returns 0 destination range beyond 8TiB returns EFBIG -copy_range: File too large +copy_range: Function not implemented
2021-06-02nametransform: check name validity on encryptionJakob Unterwurzacher
xfstests generic/523 discovered that we allowed to set xattrs with "/" in the name, but did not allow to read them later. With this change we do not allow to set them in the first place.
2021-05-30go.mod: update go-fuse to get acl fixesJakob Unterwurzacher
Done using: go get github.com/hanwen/go-fuse/v2@master go mod tidy
2021-05-30Revert "go.mod: switch to go-fuse acl branch"Jakob Unterwurzacher
Change https://review.gerrithub.io/c/hanwen/go-fuse/+/516154 was merged upstream. This reverts commit 3374afccc46d186c206cdbc218a79d8958b00acf.
2021-05-29tests: TestFileHoleCopy: accept +-4kBJakob Unterwurzacher
Failure looked like this: --- FAIL: TestFileHoleCopy (3.73s) --- FAIL: TestFileHoleCopy/k81 (0.04s) file_holes_test.go:93: size changed: st0.Blocks=88 st2.Blocks=96 file_holes_test.go:147: aborting further subtests $ findholes TestFileHoleCopy.k81.1 0 data 36864 hole 45056 data 50434 hole 50434 eof $ findholes TestFileHoleCopy.k81.2 0 data 36864 hole 45056 data 50434 hole 50434 eof $ filefrag -v TestFileHoleCopy.k81.1 Filesystem type is: ef53 File size of TestFileHoleCopy.k81.1 is 50434 (13 blocks of 4096 bytes) ext: logical_offset: physical_offset: length: expected: flags: 0: 0.. 2: 23702311.. 23702313: 3: 1: 3.. 8: 20389855.. 20389860: 6: 23702314: 2: 11.. 12: 23702314.. 23702315: 2: 20389863: last,eof TestFileHoleCopy.k81.1: 3 extents found $ filefrag -v TestFileHoleCopy.k81.2 Filesystem type is: ef53 File size of TestFileHoleCopy.k81.2 is 50434 (13 blocks of 4096 bytes) ext: logical_offset: physical_offset: length: expected: flags: 0: 0.. 2: 20389861.. 20389863: 3: 1: 3.. 4: 23702316.. 23702317: 2: 20389864: 2: 5.. 6: 20389864.. 20389865: 2: 23702318: 3: 7.. 8: 23702318.. 23702319: 2: 20389866: 4: 11.. 12: 23702320.. 23702321: 2: last,eof TestFileHoleCopy.k81.2: 4 extents found
2021-05-29fusefrontend: list "." and ".." in dir entriesJakob Unterwurzacher
Fixes xfstests generic/401
2021-05-29fusefrontend: rewrite Lseek SEEK_DATA / SEEK_HOLEJakob Unterwurzacher
In response to the discussion of the xfstests mailing list [1], I looked at the Lseek implementation, which was naive and did not handle all cases correctly. The new implementation aligns the returned values to 4096 bytes as most callers expect. A lot of tests are added to verify that we handle all cases correctly now. [1]: https://www.spinics.net/lists/fstests/msg16554.html
2021-05-29findholes: add --create, --verifyJakob Unterwurzacher
Also, change the logic for the segment walk to not rely on the total size. cp does not use the total size either, and we miss bugs by cheating!
2021-05-26contentenc: add PlainOffToCipherOff helperJakob Unterwurzacher
Will be used for improving Lseek()
2021-05-26contentenc: fix CipherSizeToPlainSize non-monoticityJakob Unterwurzacher
For an illegal cipherSize, pretend we have an additional 1-byte block. See code comment for details.
2021-05-26contentenc: update commentsJakob Unterwurzacher
Also, replace one open-coded calculation with a helper function.
2021-05-26tests: contentenc: add TestSizeToSizeJakob Unterwurzacher
TestSizeToSize tests CipherSizeToPlainSize and PlainSizeToCipherSize. Fails at the moment due to CipherSizeToPlainSize non-moniticity.
2021-05-26tests: add TestFileHoleCopyJakob Unterwurzacher
Currently fails.
2021-05-26tests: re-enable TestInoReuseEvilJakob Unterwurzacher
Problem in go-fuse has long been fixed.
2021-05-26Add contrib/findholesJakob Unterwurzacher
Utility and libs to find hole/data segments using lseek.
2021-05-26syscallcompat: add GetdentsSpecial()Jakob Unterwurzacher
GetdentsSpecial calls then Getdents syscall, with normal entries and "." / ".." split into two slices.
2021-05-26tests: add TestHaveDotdotJakob Unterwurzacher
As discovered by xfstests generic/401 [1], during the move to the v2 api we seem to have lost the "." and ".." directory entries. [1]: https://github.com/rfjakob/fuse-xfstests/blob/4ef5b032bc283743d0eb58a8a28738766e664899/screenlog.0#L520
2021-05-26stupidgcm: prefer Go stdlib over OpenSSL on Apple M1Jakob Unterwurzacher
https://github.com/rfjakob/gocryptfs/issues/556
2021-05-22syscallcompat: also refactor MkdiratUser on GOOS=darwinJakob Unterwurzacher
Breakage was: +GOOS=darwin +GOARCH=amd64 +go build -tags without_openssl internal/fusefrontend/node_dir_ops.go:45:34: cannot use context (type *fuse.Context) as type *fuse.Caller in argument to syscallcompat.MkdiratUser internal/fusefrontend/node_dir_ops.go:83:35: cannot use context (type *fuse.Context) as type *fuse.Caller in argument to syscallcompat.MkdiratUser
2021-05-22syscallcompat: refactor MkdiratUser to take fuse.ContextJakob Unterwurzacher
Let's have MkdiratUser take fuse.Context like everybody else.
2021-05-22syscallcompat: deduplicate OpenatUser/MknodatUser/SymlinkatUser/MkdiratUserJakob Unterwurzacher
Turns out the whole euid switching logic can be shared when wrapping the syscall in a closure.
2021-05-18fsck: redirect go-fuse noise to syslogJakob Unterwurzacher
2021-05-18-speed: note that XChaCha20 is not selectableJakob Unterwurzacher
This is unclear to users, as seen on https://github.com/rfjakob/gocryptfs/issues/452#issuecomment-828836651
2021-05-15Merge package-source.bash & package-static.bash scriptsv2.0-beta4Jakob Unterwurzacher
2021-05-15Update README for v2.0-beta4Jakob Unterwurzacher
2021-05-15go.mod: switch to go-fuse acl branchJakob Unterwurzacher
Until https://review.gerrithub.io/c/hanwen/go-fuse/+/516154 gets merged. Commands used: go mod edit -replace github.com/hanwen/go-fuse/v2=github.com/rfjakob/go-fuse/v2@acl go mod download github.com/hanwen/go-fuse/v2 go mod tidy
2021-05-15Add -acl flag to enable ACL enforcementJakob Unterwurzacher
With test to verify that it actually works this time: Run "make root_test". Depends-on: https://github.com/rfjakob/gocryptfs/issues/536 Fixes: https://github.com/rfjakob/gocryptfs/issues/536
2021-05-15fusefrontend: fix RENAME_NOREPLACE darwin build failureJakob Unterwurzacher
Error was: internal/fusefrontend/node.go:371:2: duplicate case syscallcompat.RENAME_NOREPLACE (value 0) in switch previous case at internal/fusefrontend/node.go:368:7 Rewrite using "if"s instead.
2021-05-08fusefrontend: avoid duplicate const definitionJakob Unterwurzacher
RENAME_NOREPLACE is already defined in syscallcompat.
2021-05-08fusefrontend: reject broken RENAME_EXCHANGE and RENAME_WHITEOUTJakob Unterwurzacher
Discovered by xfstests generic/013: or implementation for RENAME_EXCHANGE and RENAME_WHITEOUT is incomplete. Reject the flags so that the caller retries with regular rename.
2021-05-07README: fix broken markdown linksJakob Unterwurzacher
2021-04-24Update README for v2.0-beta3 releasev2.0-beta3Jakob Unterwurzacher
2021-04-24go mod: switch back to mainline go-fuseJakob Unterwurzacher
Change was merged: https://github.com/hanwen/go-fuse/commit/a90e1f463c3f172a7690a6449fe5955a180dfec3 Done using: $ go mod edit -dropreplace github.com/hanwen/go-fuse/v2 $ go get github.com/hanwen/go-fuse/v2@master go: downloading github.com/hanwen/go-fuse/v2 v2.1.1-0.20210423170155-a90e1f463c3f go get: upgraded github.com/hanwen/go-fuse/v2 v2.0.4-0.20210125162859-8e0bbdb16cb7 => v2.1.1-0.20210423170155-a90e1f463c3f Related: https://github.com/rfjakob/gocryptfs/issues/549
2021-04-07Doc: update performance.txtJakob Unterwurzacher
2021-04-07fusefrontend: make dirCache work for "node itself"Jakob Unterwurzacher
"node itself" can be converted to node + child by ascending one level. Performance gains are spectacular, as will be seen in the next commit.
2021-04-05profiling/ls.bash: add -nosyslogJakob Unterwurzacher
This makes sure we actually see the dirCache stats.
2021-04-05fusefrontend: print dirCache stats after unmountJakob Unterwurzacher
2021-04-04fs: more idiomatic dirCache struct namingJakob Unterwurzacher
2021-04-03performance.txt: add dirfd caching resultsJakob Unterwurzacher
Also, add v2.0-beta2-16-geaca820. I bisected the ls performance regression to this commit.
2021-04-03fs: add initial dirfd cachingJakob Unterwurzacher
dirfd caching was temporarily removed when moving to the v2api. Add it back to gain back some lost speed.
2021-04-03tests: fusefronted: fix TestOpenBackingDirJakob Unterwurzacher
This test only worked accidentially, and would break once dirfd caching is added. fs.Mkdir(..., "dir1/dir2", ...) is illegal (child name cannot contain slashes).