Skip to content

Commit a20085b

Browse files
committed
Merge branch 'rfjakob:master' into badnamecontent
2 parents 6622b96 + 98ab59c commit a20085b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1052
-168
lines changed

Documentation/performance.txt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,19 @@ v1.7.1 450 697 11.5 9.5 1.5 3.6
5959
**********************************************
6060
* CPU = Core i5-3470, governor = performance *
6161
**********************************************
62-
v1.7.1 556 1000 9.0 4.2 0.9 2.0 go1.13.6, Linux 5.4.17
63-
v1.7.1 577 1100 8.3 4.2 0.9 2.0 go1.14.2, Linux 5.6.7
64-
v1.7.1-60-gb23f77c 472 1100 12.7 4.2 0.8 2.0
65-
v1.8.0 410 1000 17.5 6.7 5.4 7.8 go1.15.3, Linux 5.8.13
66-
v2.0-beta1 387 1100 36.2 14.4 12.8 19.3
67-
v2.0-beta1-5-gc943ed3 417 1000 30.4 12.7 9.9 16.4
68-
v2.0-beta1-6 529 1100 17.5 9.0 3.6 9.0
62+
v1.7.1 556 1000 9.0 4.2 0.9 2.0 go1.13.6, Linux 5.4.17
63+
v1.7.1 577 1100 8.3 4.2 0.9 2.0 go1.14.2, Linux 5.6.7
64+
v1.7.1-60-gb23f77c 472 1100 12.7 4.2 0.8 2.0
65+
v1.8.0 410 1000 17.5 6.7 5.4 7.8 go1.15.3, Linux 5.8.13
66+
v2.0-beta1 387 1100 36.2 14.4 12.8 19.3
67+
v2.0-beta1-5-gc943ed3 417 1000 30.4 12.7 9.9 16.4
68+
v2.0-beta1-6 529 1100 17.5 9.0 3.6 9.0
6969
v2.0-beta1-9-g029e44d 477 1000 15.5 8.7 2.8 7.6
7070
v2.0-beta2-16-geaca820 542 997 15.9 8.8 6.2 7.8 go1.16.2, Linux 5.11.10 fusefrontend: do not encrypt ACLs
7171
v2.0-beta2-36-g6aae2aa 505 1000 16.1 8.2 6.3 7.7
7272
v2.0-beta2-37-g24d5d39 558 1000 12.3 6.4 4.4 2.8 fs: add initial dirfd caching
7373
v2.0-beta2-42-g4a07d65 549 1000 8.2 4.7 1.8 2.4 fusefrontend: make dirCache work for "node itself"
74+
v2.0 420 1000 8.5 4.5 1.8 2.3 go1.16.5, Linux 5.11.21
7475

7576
Results for EncFS for comparison (benchmark.bash -encfs):
7677

README.md

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,28 @@ as well as in the go-fuse library.
9696
Compile
9797
-------
9898

99-
With go 1.11 or higher:
99+
Install Go 1.11 or higher:
100+
101+
* Debian/Ubuntu: `apt install golang`
102+
* Fedora: `dnf install golang`
103+
104+
Then, download the source code and compile:
100105

101106
$ git clone https://github.com/rfjakob/gocryptfs.git
102107
$ cd gocryptfs
103-
$ ./build.bash
108+
$ ./build-without-openssl.bash
104109

105-
build.bash needs the OpenSSL headers installed (Debian: `apt install libssl-dev`,
106-
Fedora: `dnf install openssl-devel`). Alternatively, you can compile
107-
without OpenSSL using
110+
This will compile a static binary that uses the Go stdlib crypto backend.
108111

109-
$ ./build-without-openssl.bash
112+
If you want to use the OpenSSL crypto backend (faster on
113+
old CPUs lacking AES-NI), you have to install a few dependencies:
114+
115+
* Debian/Ubuntu: `apt install libssl-dev gcc pkg-config`
116+
* Fedora: `dnf install openssl-devel gcc pkg-config`
117+
118+
Then, run:
119+
120+
$ ./build.bash
110121

111122
Use
112123
---
@@ -166,9 +177,11 @@ Example for a CPU without AES-NI:
166177

167178
```
168179
$ ./gocryptfs -speed
169-
AES-GCM-256-OpenSSL 165.67 MB/s (selected in auto mode)
170-
AES-GCM-256-Go 49.62 MB/s
171-
AES-SIV-512-Go 39.98 MB/s
180+
gocryptfs v2.0; go-fuse v2.1.1-0.20210508151621-62c5aa1919a7; 2021-06-06 go1.16.5 linux/amd64
181+
AES-GCM-256-OpenSSL 536.63 MB/s
182+
AES-GCM-256-Go 831.84 MB/s (selected in auto mode)
183+
AES-SIV-512-Go 155.85 MB/s
184+
XChaCha20-Poly1305-Go 700.02 MB/s (benchmark only, not selectable yet)
172185
```
173186

174187
You can run `./benchmark.bash` to run gocryptfs' canonical set of
@@ -177,22 +190,30 @@ tarball, recursively listing and finally deleting it. The output will
177190
look like this:
178191

179192
```
180-
$ ./benchmark.bash
181-
Testing gocryptfs at /tmp/benchmark.bash.DwL: gocryptfs v1.6; go-fuse v20170619-45-g95c6370; 2018-08-18 go1.10.3
182-
WRITE: 262144000 bytes (262 MB, 250 MiB) copied, 1.1033 s, 238 MB/s
183-
READ: 262144000 bytes (262 MB, 250 MiB) copied, 0.945291 s, 277 MB/s
184-
UNTAR: 17.768
185-
MD5: 8.459
186-
LS: 1.460
187-
RM: 3.379
193+
$ ./benchmark.bash
194+
Testing gocryptfs at /tmp/benchmark.bash.xFD: gocryptfs v2.0; go-fuse v2.1.1-0.20210508151621-62c5aa1919a7; 2021-06-06 go1.16.5 linux/amd64
195+
WRITE: 262144000 bytes (262 MB, 250 MiB) copied, 0,698174 s, 375 MB/s
196+
READ: 262144000 bytes (262 MB, 250 MiB) copied, 0,268916 s, 975 MB/s
197+
UNTAR: 8,970
198+
MD5: 4,846
199+
LS: 1,851
200+
RM: 2,367
188201
```
189202

190203
Changelog
191204
---------
192205

206+
v2.0.1, 2021-06-07
207+
* Fix symlink creation reporting the wrong size, causing git to report it as modified
208+
([#574](https://github.com/rfjakob/gocryptfs/issues/574))
209+
210+
v2.0, 2021-06-05
211+
* Fix a few [issues discovered by xfstests](https://github.com/rfjakob/fuse-xfstests/wiki/results_2021-05-19)
212+
* Biggest change: rewrite SEEK_HOLE / SEEK_DATA logic (now emulates 4k alignment)
213+
193214
v2.0-beta4, 2021-05-15
194-
* Make ACLs *actually* work (pass `-acl` to enable) ([#536](https://github.com/rfjakob/gocryptfs/issues/536))
195-
* Blocklist RENAME_EXCHANGE and RENAME_WHITEOUT (broken as discovered by [fuse-xfstest/gocryptfs-2019-12](https://github.com/rfjakob/fuse-xfstests/tree/gocryptfs-2019-12))
215+
* **Make ACLs *actually* work (pass `-acl` to enable)** ([#536](https://github.com/rfjakob/gocryptfs/issues/536))
216+
* Blocklist `RENAME_EXCHANGE` and `RENAME_WHITEOUT` (broken as discovered by [fuse-xfstest/gocryptfs-2019-12](https://github.com/rfjakob/fuse-xfstests/tree/gocryptfs-2019-12))
196217

197218
v2.0-beta3, 2021-04-24
198219
* MANPAGE: Split options into sections acc. to where they apply ([#517](https://github.com/rfjakob/gocryptfs/issues/517))

build.bash

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,9 @@ fi
9494
# Actual "go build" call for gocryptfs
9595
go build "-ldflags=$GO_LDFLAGS" "$@"
9696
# Additional binaries
97-
(cd gocryptfs-xray; go build "-ldflags=$GO_LDFLAGS" "$@")
98-
(cd contrib/statfs; go build "-ldflags=$GO_LDFLAGS" "$@")
97+
for d in gocryptfs-xray contrib/statfs contrib/findholes contrib/atomicrename ; do
98+
(cd "$d"; go build "-ldflags=$GO_LDFLAGS" "$@")
99+
done
99100

100101
./gocryptfs -version
101102

contrib/atomicrename/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/atomicrename

contrib/atomicrename/main.go

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
package main
2+
3+
import (
4+
"bytes"
5+
"flag"
6+
"fmt"
7+
"io/ioutil"
8+
"os"
9+
"strings"
10+
"sync/atomic"
11+
"syscall"
12+
)
13+
14+
const fileCount = 100
15+
16+
type stats struct {
17+
renameOk int
18+
renameError int
19+
readOk int
20+
readError int
21+
readContentMismatch int
22+
}
23+
24+
func usage() {
25+
fmt.Printf(`atomicrename creates %d "src" files in the current directory, renames
26+
them in random order over a single "dst" file while reading the "dst"
27+
file concurrently in a loop.
28+
29+
Progress and errors are reported as they occour in addition to a summary
30+
printed at the end. cifs and fuse filesystems are known to fail, local
31+
filesystems and nfs seem ok.
32+
33+
See https://github.com/hanwen/go-fuse/issues/398 for background info.
34+
`, fileCount)
35+
os.Exit(1)
36+
}
37+
38+
func main() {
39+
flag.Usage = usage
40+
flag.Parse()
41+
42+
hello := []byte("hello world")
43+
srcFiles := make(map[string]struct{})
44+
45+
// prepare source files
46+
fmt.Print("creating files")
47+
for i := 0; i < fileCount; i++ {
48+
srcName := fmt.Sprintf("src.atomicrename.%d", i)
49+
srcFiles[srcName] = struct{}{}
50+
buf := bytes.Repeat([]byte("_"), i)
51+
buf = append(buf, hello...)
52+
if err := ioutil.WriteFile(srcName, buf, 0600); err != nil {
53+
panic(err)
54+
}
55+
fmt.Print(".")
56+
}
57+
fmt.Print("\n")
58+
59+
// prepare destination file
60+
const dstName = "dst.atomicrename"
61+
if err := ioutil.WriteFile(dstName, hello, 0600); err != nil {
62+
panic(err)
63+
}
64+
65+
var running int32 = 1
66+
67+
stats := stats{}
68+
69+
// read thread
70+
go func() {
71+
for atomic.LoadInt32(&running) == 1 {
72+
have, err := ioutil.ReadFile(dstName)
73+
if err != nil {
74+
fmt.Println(err)
75+
stats.readError++
76+
continue
77+
}
78+
if !strings.HasSuffix(string(have), string(hello)) {
79+
fmt.Printf("content mismatch: have %q\n", have)
80+
stats.readContentMismatch++
81+
continue
82+
}
83+
fmt.Printf("content ok len=%d\n", len(have))
84+
stats.readOk++
85+
}
86+
}()
87+
88+
// rename thread = main thread
89+
for srcName := range srcFiles {
90+
if err := os.Rename(srcName, dstName); err != nil {
91+
fmt.Println(err)
92+
stats.renameError++
93+
}
94+
stats.renameOk++
95+
}
96+
// Signal the Read goroutine to stop when loop is done
97+
atomic.StoreInt32(&running, 0)
98+
99+
syscall.Unlink(dstName)
100+
fmt.Printf("stats: %#v\n", stats)
101+
}

contrib/findholes/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/findholes

0 commit comments

Comments
 (0)