aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/weedfs_file_sync.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/mount/weedfs_file_sync.go')
-rw-r--r--weed/mount/weedfs_file_sync.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/mount/weedfs_file_sync.go b/weed/mount/weedfs_file_sync.go
index 74e16d43f..762a9b8de 100644
--- a/weed/mount/weedfs_file_sync.go
+++ b/weed/mount/weedfs_file_sync.go
@@ -104,9 +104,6 @@ func (wfs *WFS) doFlush(fh *FileHandle, uid, gid uint32) fuse.Status {
}
}
- fhActiveLock := fh.wfs.fhLockTable.AcquireLock("doFlush", fh.fh, util.ExclusiveLock)
- defer fh.wfs.fhLockTable.ReleaseLock(fh.fh, fhActiveLock)
-
if !fh.dirtyMetadata {
return fuse.OK
}
@@ -115,6 +112,9 @@ func (wfs *WFS) doFlush(fh *FileHandle, uid, gid uint32) fuse.Status {
return fuse.Status(syscall.ENOSPC)
}
+ fhActiveLock := fh.wfs.fhLockTable.AcquireLock("doFlush", fh.fh, util.ExclusiveLock)
+ defer fh.wfs.fhLockTable.ReleaseLock(fh.fh, fhActiveLock)
+
err := wfs.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error {
fh.entryLock.Lock()
defer fh.entryLock.Unlock()