Browse Source

FUSE mount: clean up file handles during renaming

resolve dir rename when file is still open. Need to clean the file handles as soon as possible.

These can happen out of order:
file rename, then file release
file release, then file rename
Chris Lu 4 years ago
parent
commit
42a338d7b0
1 changed files with 1 additions and 0 deletions
  1. 1 0
      weed/filesys/dir_rename.go

+ 1 - 0
weed/filesys/dir_rename.go

@@ -42,6 +42,7 @@ func (dir *Dir) Rename(ctx context.Context, req *fuse.RenameRequest, newDirector
 
 		// fmt.Printf("rename path: %v => %v\n", oldPath, newPath)
 		dir.wfs.fsNodeCache.Move(oldPath, newPath)
+		delete(dir.wfs.handles, oldPath.AsInode())
 
 	}