mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
[mount]Fix copy file range (#4407)
* fix:mount deadlock * fix --------- Co-authored-by: zemul <zhouzemiao@ihuman.com>
This commit is contained in:
parent
e1b92bc701
commit
68f1cc34a5
|
@ -46,18 +46,14 @@ func (wfs *WFS) CopyFileRange(cancel <-chan struct{}, in *fuse.CopyFileRangeIn)
|
||||||
// lock source and target file handles
|
// lock source and target file handles
|
||||||
fhOut.Lock()
|
fhOut.Lock()
|
||||||
defer fhOut.Unlock()
|
defer fhOut.Unlock()
|
||||||
fhOut.entryLock.Lock()
|
|
||||||
defer fhOut.entryLock.Unlock()
|
|
||||||
|
|
||||||
if fhOut.entry == nil {
|
if fhOut.entry == nil {
|
||||||
return 0, fuse.ENOENT
|
return 0, fuse.ENOENT
|
||||||
}
|
}
|
||||||
|
|
||||||
if fhIn.fh != fhOut.fh {
|
if fhIn.fh != fhOut.fh {
|
||||||
fhIn.Lock()
|
fhIn.RLock()
|
||||||
defer fhIn.Unlock()
|
defer fhIn.RUnlock()
|
||||||
fhIn.entryLock.Lock()
|
|
||||||
defer fhIn.entryLock.Unlock()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// directories are not supported
|
// directories are not supported
|
||||||
|
|
Loading…
Reference in a new issue