From ceb620a30a51c565bd281b2eae0d2c62701fc49d Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 12 May 2021 22:04:47 -0700 Subject: [PATCH] directory rename: change directory name after renaming fix https://github.com/chrislusf/seaweedfs/issues/2068 --- weed/filesys/dir_rename.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/weed/filesys/dir_rename.go b/weed/filesys/dir_rename.go index b07710d17..df05dcd3f 100644 --- a/weed/filesys/dir_rename.go +++ b/weed/filesys/dir_rename.go @@ -68,10 +68,15 @@ func (dir *Dir) Rename(ctx context.Context, req *fuse.RenameRequest, newDirector newFsNode := NodeWithId(newPath.AsInode()) dir.wfs.Server.InvalidateInternalNode(oldFsNode, newFsNode, func(internalNode fs.Node) { if file, ok := internalNode.(*File); ok { - glog.V(4).Infof("internal node %s", file.Name) + glog.V(4).Infof("internal file node %s", file.Name) file.Name = req.NewName file.id = uint64(newFsNode) } + if dir, ok := internalNode.(*Dir); ok { + glog.V(4).Infof("internal dir node %s", dir.name) + dir.name = req.NewName + dir.id = uint64(newFsNode) + } }) // change file handle