aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/dir.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-01-19 12:31:56 -0800
committerChris Lu <chris.lu@gmail.com>2020-01-19 12:31:56 -0800
commit2f15e9346696d18032b9d2bfffe459635cb36171 (patch)
tree3236719ecbdcb9c1ed6f1e84eff86aa5ccf374ce /weed/filesys/dir.go
parent04019aa161dcfe04511da41e198c9d3b5b1b66dc (diff)
downloadseaweedfs-2f15e9346696d18032b9d2bfffe459635cb36171.tar.xz
seaweedfs-2f15e9346696d18032b9d2bfffe459635cb36171.zip
mount: rename also clear the cache
fix https://github.com/chrislusf/seaweedfs/issues/1182
Diffstat (limited to 'weed/filesys/dir.go')
-rw-r--r--weed/filesys/dir.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go
index 95b26f409..ac6291319 100644
--- a/weed/filesys/dir.go
+++ b/weed/filesys/dir.go
@@ -182,7 +182,7 @@ func (dir *Dir) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse.
glog.V(4).Infof("dir Lookup %s: %s", dir.Path, req.Name)
var entry *filer_pb.Entry
- fullFilePath := path.Join(dir.Path, req.Name)
+ fullFilePath := string(filer2.NewFullPath(dir.Path, req.Name))
item := dir.wfs.listDirectoryEntriesCache.Get(fullFilePath)
if item != nil && !item.Expired() {
@@ -233,7 +233,7 @@ func (dir *Dir) ReadDirAll(ctx context.Context) (ret []fuse.Dirent, err error) {
cacheTtl := 5 * time.Minute
readErr := filer2.ReadDirAllEntries(ctx, dir.wfs, dir.Path, "", func(entry *filer_pb.Entry, isLast bool) {
- fullpath := path.Join(dir.Path, entry.Name)
+ fullpath := string(filer2.NewFullPath(dir.Path, entry.Name))
inode := uint64(util.HashStringToLong(fullpath))
if entry.IsDirectory {
dirent := fuse.Dirent{Inode: inode, Name: entry.Name, Type: fuse.DT_Dir}
@@ -295,7 +295,7 @@ func (dir *Dir) removeOneFile(ctx context.Context, req *fuse.RemoveRequest) erro
func (dir *Dir) removeFolder(ctx context.Context, req *fuse.RemoveRequest) error {
- dir.wfs.listDirectoryEntriesCache.Delete(path.Join(dir.Path, req.Name))
+ dir.wfs.listDirectoryEntriesCache.Delete(string(filer2.NewFullPath(dir.Path, req.Name)))
return dir.wfs.WithFilerClient(ctx, func(client filer_pb.SeaweedFilerClient) error {