| Age | Commit message (Collapse) | Author | 
|---|
|  | Fixes xfstests generic/401 | 
|  | 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 | 
|  | 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! | 
|  | Will be used for improving Lseek() | 
|  | For an illegal cipherSize, pretend we have an additional
1-byte block.
See code comment for details. | 
|  | Also, replace one open-coded calculation with a
helper function. | 
|  | TestSizeToSize tests CipherSizeToPlainSize and PlainSizeToCipherSize.
Fails at the moment due to CipherSizeToPlainSize non-moniticity. | 
|  | Currently fails. | 
|  | Problem in go-fuse has long been fixed. | 
|  | Utility and libs to find hole/data segments using lseek. | 
|  | GetdentsSpecial calls then Getdents syscall,
with normal entries and "." / ".." split into two slices. | 
|  | 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 | 
|  | https://github.com/rfjakob/gocryptfs/issues/556 | 
|  | 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 | 
|  | Let's have MkdiratUser take fuse.Context like everybody
else. | 
|  | Turns out the whole euid switching logic can be shared when
wrapping the syscall in a closure. | 
|  |  | 
|  | This is unclear to users, as seen on
https://github.com/rfjakob/gocryptfs/issues/452#issuecomment-828836651 | 
|  |  | 
|  |  | 
|  | 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 | 
|  | 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 | 
|  | 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. | 
|  | RENAME_NOREPLACE is already defined in syscallcompat. | 
|  | 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. | 
|  |  | 
|  |  | 
|  | 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 | 
|  |  | 
|  | "node itself" can be converted to node + child by
ascending one level.
Performance gains are spectacular, as will be seen
in the next commit. | 
|  | This makes sure we actually see the dirCache stats. | 
|  |  | 
|  |  | 
|  | Also, add v2.0-beta2-16-geaca820. I bisected the ls performance
regression to this commit. | 
|  | dirfd caching was temporarily removed when moving
to the v2api. Add it back to gain back some lost speed. | 
|  | This test only worked accidentially, and would
break once dirfd caching is added.
fs.Mkdir(..., "dir1/dir2", ...) is illegal
(child name cannot contain slashes). | 
|  | Use the n.prepareAtSyscall() wrapper instead. Prepares
for adding caching into n.prepareAtSyscall(). | 
|  | 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. | 
|  |  | 
|  | 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 | 
|  |  | 
|  | 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 | 
|  |  | 
|  | I only use package-static.bash nowadays. | 
|  | "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 | 
|  | Towards better test coverage of shared backing storage
mounts.
https://github.com/rfjakob/gocryptfs/issues/525 | 
|  | The inode number is not stable with `-sharedstorage`.
Ignore it.
Failure was like this:
--- FAIL: TestFallocate (0.02s)
    helpers.go:229: Stat vs Fstat mismatch:
        st= {59 11543 1 33188 1026 1026 0 0 0 4096 8 {1616315569 838232716} {1616315569 838232716} {1616315569 838232716} [0 0 0]}
        st2={59 11545 1 33188 1026 1026 0 0 0 4096 8 {1616315569 838232716} {1616315569 838232716} {1616315569 838232716} [0 0 0]} | 
|  | And deduplicate the code a little. | 
|  | The Open() and Create() paths used different inode numbers,
which broke openfiletable locking against concurred readers. | 
|  | Currently fails like this:
=== RUN   TestRmwRace
doRead 0: corrupt block #0: cipher: message authentication failed
-wpanic turns this warning into a panic: doRead 0: corrupt block #0: cipher: message authentication failed
panic: -wpanic turns this warning into a panic: doRead 0: corrupt block #0: cipher: message authentication failed
goroutine 1293 [running]:
log.(*Logger).Panic(0xc00011c230, 0xc0003b17c8, 0x1, 0x1)
	log/log.go:224 +0xac
github.com/rfjakob/gocryptfs/internal/tlog.(*toggledLogger).Printf(0xc00007a780, 0x55a821a766a1, 0x20, 0xc0003b19f0, 0x3, 0x3)
	github.com/rfjakob/gocryptfs/internal/tlog/log.go:78 +0x1ef
github.com/rfjakob/gocryptfs/internal/fusefrontend.(*File).doRead(0xc0001ff420, 0x0, 0x0, 0x0, 0x0, 0x1000, 0x0, 0x1, 0xc000880000, 0x1020)
	github.com/rfjakob/gocryptfs/internal/fusefrontend/file.go:201 +0x8c9
github.com/rfjakob/gocryptfs/internal/fusefrontend.(*File).doWrite(0xc0001ff420, 0xc000248428, 0x10, 0x30, 0xff0, 0x3, 0x18)
	github.com/rfjakob/gocryptfs/internal/fusefrontend/file.go:291 +0xc9e
github.com/rfjakob/gocryptfs/internal/fusefrontend.(*File).Write(0xc0001ff420, 0x55a821b306a0, 0xc000fbde90, 0xc000248428, 0x10, 0x30, 0xff0, 0x7f4a00000000, 0x0)
	github.com/rfjakob/gocryptfs/internal/fusefrontend/file.go:378 +0x25e
github.com/hanwen/go-fuse/v2/fs.(*rawBridge).Write(0xc000168140, 0xc000096000, 0xc0002483d8, 0xc000248428, 0x10, 0x30, 0x55a821ad40e0)
	github.com/hanwen/go-fuse/v2@v2.0.4-0.20210125162859-8e0bbdb16cb7/fs/bridge.go:819 +0x26d
github.com/hanwen/go-fuse/v2/fuse.doWrite(0xc000170160, 0xc000248240)
	github.com/hanwen/go-fuse/v2@v2.0.4-0.20210125162859-8e0bbdb16cb7/fuse/opcode.go:191 +0x6f
github.com/hanwen/go-fuse/v2/fuse.(*Server).handleRequest(0xc000170160, 0xc000248240, 0xc000000000)
	github.com/hanwen/go-fuse/v2@v2.0.4-0.20210125162859-8e0bbdb16cb7/fuse/server.go:472 +0x2be
github.com/hanwen/go-fuse/v2/fuse.(*Server).loop(0xc000170160, 0xc000cd4101)
	github.com/hanwen/go-fuse/v2@v2.0.4-0.20210125162859-8e0bbdb16cb7/fuse/server.go:445 +0x198
created by github.com/hanwen/go-fuse/v2/fuse.(*Server).readRequest
	github.com/hanwen/go-fuse/v2@v2.0.4-0.20210125162859-8e0bbdb16cb7/fuse/server.go:312 +0x41d
    matrix_test.go:354: Write failed |