delay new file creation unless file is opened exclusively

This commit is contained in:
Chris Lu
2021-04-19 10:58:25 -07:00
parent 1faafce832
commit 83cf94ad2d
2 changed files with 25 additions and 4 deletions

View File

@@ -265,6 +265,7 @@ func (file *File) maybeLoadEntry(ctx context.Context) (entry *filer_pb.Entry, er
file.wfs.handlesLock.Lock()
handle, found := file.wfs.handles[file.Id()]
file.wfs.handlesLock.Unlock()
entry = file.entry
if found {
glog.V(4).Infof("maybeLoadEntry found opened file %s/%s: %v %v", file.dir.FullPath(), file.Name, handle.f.entry, entry)
entry = handle.f.entry