summaryrefslogtreecommitdiff
path: root/internal/fusefrontend/file2_allocate_truncate.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2020-07-12 13:13:24 +0200
committerJakob Unterwurzacher2020-07-12 13:13:24 +0200
commitb1d631d432ea0a7158060c31de6dd4370d6606e8 (patch)
tree08cfcd047879a2716f2199d32e84cfeeb6170b7e /internal/fusefrontend/file2_allocate_truncate.go
parent6196a5b5fe78f7a5b8e38c00e656f70c1592e1df (diff)
v2api: fix double-lock in truncate
Diffstat (limited to 'internal/fusefrontend/file2_allocate_truncate.go')
-rw-r--r--internal/fusefrontend/file2_allocate_truncate.go9
1 files changed, 0 insertions, 9 deletions
diff --git a/internal/fusefrontend/file2_allocate_truncate.go b/internal/fusefrontend/file2_allocate_truncate.go
index 9413b90..b504c50 100644
--- a/internal/fusefrontend/file2_allocate_truncate.go
+++ b/internal/fusefrontend/file2_allocate_truncate.go
@@ -84,15 +84,6 @@ func (f *File2) Allocate(ctx context.Context, off uint64, sz uint64, mode uint32
// truncate - called from Setattr.
func (f *File2) truncate(newSize uint64) (errno syscall.Errno) {
- f.fdLock.RLock()
- defer f.fdLock.RUnlock()
- if f.released {
- // The file descriptor has been closed concurrently.
- tlog.Warn.Printf("ino%d fh%d: Truncate on released file", f.qIno.Ino, f.intFd())
- return syscall.EBADF
- }
- f.fileTableEntry.ContentLock.Lock()
- defer f.fileTableEntry.ContentLock.Unlock()
var err error
// Common case first: Truncate to zero
if newSize == 0 {