Commit df17f414 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fuse/nodefs: fix Fd locking for Utimens.

parent e94ac04f
...@@ -81,6 +81,9 @@ func (f *loopbackFile) Utimens(a *time.Time, m *time.Time) fuse.Status { ...@@ -81,6 +81,9 @@ func (f *loopbackFile) Utimens(a *time.Time, m *time.Time) fuse.Status {
tv[1] = syscall.NsecToTimeval(n) tv[1] = syscall.NsecToTimeval(n)
} }
f.lock.Lock()
err := syscall.Futimes(int(f.File.Fd()), tv) err := syscall.Futimes(int(f.File.Fd()), tv)
f.lock.Unlock()
return fuse.ToStatus(err) return fuse.ToStatus(err)
} }
...@@ -36,6 +36,8 @@ func (f *loopbackFile) Utimens(a *time.Time, m *time.Time) fuse.Status { ...@@ -36,6 +36,8 @@ func (f *loopbackFile) Utimens(a *time.Time, m *time.Time) fuse.Status {
tv[1] = syscall.NsecToTimeval(n) tv[1] = syscall.NsecToTimeval(n)
} }
f.lock.Lock()
err := syscall.Futimes(int(f.File.Fd()), tv) err := syscall.Futimes(int(f.File.Fd()), tv)
f.lock.Unlock()
return fuse.ToStatus(err) return fuse.ToStatus(err)
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment