ensure entry view cache is invalidated

This commit is contained in:
chrislu
2022-01-17 23:02:30 -08:00
parent f4ad63528a
commit b2acfd75e9
2 changed files with 9 additions and 1 deletions

View File

@@ -140,7 +140,15 @@ func (file *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *f
}
}
}
// set the new chunks and reset entry cache
entry.Chunks = chunks
file.wfs.handlesLock.Lock()
existingHandle, found := file.wfs.handles[file.Id()]
file.wfs.handlesLock.Unlock()
if found {
existingHandle.entryViewCache = nil
}
}
entry.Attributes.Mtime = time.Now().Unix()
entry.Attributes.FileSize = req.Size