Skip to content

Commit 891a3b4

Browse files
committed
fusefrontend: Utimens: one more band-aid
Revert once hanwen/go-fuse#131 is merged.
1 parent 4866785 commit 891a3b4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

internal/fusefrontend/file.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,10 @@ func (f *file) GetAttr(a *fuse.Attr) fuse.Status {
391391
const BrokenAtimeOmit = true
392392

393393
func (f *file) Utimens(a *time.Time, m *time.Time) fuse.Status {
394-
if a == nil && BrokenAtimeOmit {
394+
if BrokenAtimeOmit {
395395
// Band-aid for a nil pointer crash, described in
396396
// https://github.com/rfjakob/gocryptfs/issues/48
397+
// Also band-aid for "mtime gets set to atime".
397398
//
398399
// TODO drop this once https://github.com/hanwen/go-fuse/pull/131 is
399400
// merged

tests/matrix/matrix_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,8 @@ type utimesTestcaseStruct struct {
660660
func compareUtimes(want [2]syscall.Timespec, actual [2]syscall.Timespec) error {
661661
tsNames := []string{"atime", "mtime"}
662662
for i := range want {
663-
if i == 1 {
663+
if fusefrontend.BrokenAtimeOmit && i == 0 {
664+
// Don't check atime. It's broken in go-fuse.
664665
// TODO remove this once the pull request is merged:
665666
// https://github.com/hanwen/go-fuse/pull/131
666667
continue
@@ -702,7 +703,7 @@ func doTestUtimesNano(t *testing.T, path string) {
702703
if fusefrontend.BrokenAtimeOmit {
703704
// TODO remove this once the pull request is merged:
704705
// https://github.com/hanwen/go-fuse/pull/131
705-
utimeTestcases = utimeTestcases[:1]
706+
utimeTestcases = utimeTestcases[0:0]
706707
}
707708
for i, tc := range utimeTestcases {
708709
err := syscall.UtimesNano(path, tc.in[:])

0 commit comments

Comments
 (0)