diff options
| author | chrislu <chris.lu@gmail.com> | 2023-09-23 10:35:29 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2023-09-23 10:35:29 -0700 |
| commit | ca1a5457ae3ce8043170a052cc841e6c73023fd6 (patch) | |
| tree | b538f217f2c03209e5f7a999fab026d48e841845 /weed/mount/weedfs_file_sync.go | |
| parent | 186b1f029bcd67840803d8b611c571c186f52680 (diff) | |
| download | seaweedfs-origin/test-reverting-lock-table.tar.xz seaweedfs-origin/test-reverting-lock-table.zip | |
only revert lock tableorigin/test-reverting-lock-table
Diffstat (limited to 'weed/mount/weedfs_file_sync.go')
| -rw-r--r-- | weed/mount/weedfs_file_sync.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/weed/mount/weedfs_file_sync.go b/weed/mount/weedfs_file_sync.go index 74e16d43f..4254e3830 100644 --- a/weed/mount/weedfs_file_sync.go +++ b/weed/mount/weedfs_file_sync.go @@ -7,7 +7,6 @@ import ( "github.com/seaweedfs/seaweedfs/weed/filer" "github.com/seaweedfs/seaweedfs/weed/glog" "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" - "github.com/seaweedfs/seaweedfs/weed/util" "syscall" "time" ) @@ -90,6 +89,8 @@ func (wfs *WFS) Fsync(cancel <-chan struct{}, in *fuse.FsyncIn) (code fuse.Statu } func (wfs *WFS) doFlush(fh *FileHandle, uid, gid uint32) fuse.Status { + fh.Lock() + defer fh.Unlock() // flush works at fh level fileFullPath := fh.FullPath() @@ -104,9 +105,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 } |
