summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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).
2021-04-03fusefronted: replace last rn.openBackingDir() callsJakob Unterwurzacher
Use the n.prepareAtSyscall() wrapper instead. Prepares for adding caching into n.prepareAtSyscall().
2021-04-02tests: sharedstorage: wait 100ms longer for cache expiryJakob Unterwurzacher
With 1.0 seconds we see failures on Travis, example: https://travis-ci.org/github/rfjakob/gocryptfs/builds/765648739 With 1.1 seconds it seems to always work.
2021-03-30profiling: add ls.bashJakob Unterwurzacher
2021-03-30go.mod: temporarily switch to go-fuse forkJakob Unterwurzacher
Until https://review.gerrithub.io/c/hanwen/go-fuse/+/513646/2 gets merged. Commands used: go mod edit -replace github.com/hanwen/go-fuse/v2=github.com/rfjakob/go-fuse/v2@TestStaleHardlinks go mod download github.com/hanwen/go-fuse/v2 go mod tidy
2021-03-30tests: sharedstorage: add TestStaleHardlinksJakob Unterwurzacher
2021-03-27package-static.bash: add gocryptfs-xray to tarballJakob Unterwurzacher
Requested here https://github.com/rfjakob/gocryptfs/issues/558 and here https://github.com/rfjakob/gocryptfs/issues/496 Closes https://github.com/rfjakob/gocryptfs/issues/496
2021-03-27gocrypts-xray: add -version flagJakob Unterwurzacher
2021-03-27Delete obsolete script package.bashJakob Unterwurzacher
I only use package-static.bash nowadays.
2021-03-26README: fix compile instructions for Go 1.13+Jakob Unterwurzacher
"go get -d" does not download to GOPATH/src anymore: https://github.com/golang/go/issues/31529 Use explicit "git clone" to the current directory as suggested in https://github.com/golang/go/issues/31529#issuecomment-484920157 . Fixes https://github.com/rfjakob/gocryptfs/issues/553