diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-04-16 02:55:09 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-04-18 13:06:38 -0700 |
| commit | d9a2a7f1c4593c20ec9a92b98b726af7b32baff3 (patch) | |
| tree | 2ce7aa6c2c28a8af76b75e0342af8f157f0d78fb /weed/filesys/dir_rename.go | |
| parent | 54410ca955cf4078684bca17b4363dc33ef433ed (diff) | |
| download | seaweedfs-d9a2a7f1c4593c20ec9a92b98b726af7b32baff3.tar.xz seaweedfs-d9a2a7f1c4593c20ec9a92b98b726af7b32baff3.zip | |
WIP
no memory issue
if some directory is removed, it may have this error
$ rm -Rf ~/tmp/m2/s1
rm: fts_read: Device not configured
Diffstat (limited to 'weed/filesys/dir_rename.go')
| -rw-r--r-- | weed/filesys/dir_rename.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/weed/filesys/dir_rename.go b/weed/filesys/dir_rename.go index d2acad4b2..7bc705102 100644 --- a/weed/filesys/dir_rename.go +++ b/weed/filesys/dir_rename.go @@ -64,19 +64,17 @@ func (dir *Dir) Rename(ctx context.Context, req *fuse.RenameRequest, newDirector return fuse.EIO } - // fmt.Printf("rename path: %v => %v\n", oldPath, newPath) - dir.wfs.fsNodeCache.Move(oldPath, newPath) - // change file handle dir.wfs.handlesLock.Lock() defer dir.wfs.handlesLock.Unlock() inodeId := oldPath.AsInode() existingHandle, found := dir.wfs.handles[inodeId] if !found || existingHandle == nil { - return err + return nil } + glog.V(4).Infof("opened filehandle %s => %s", oldPath, newPath) delete(dir.wfs.handles, inodeId) dir.wfs.handles[newPath.AsInode()] = existingHandle - return err + return nil } |
