diff options
Diffstat (limited to 'weed/mount/inode_to_path.go')
| -rw-r--r-- | weed/mount/inode_to_path.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/weed/mount/inode_to_path.go b/weed/mount/inode_to_path.go index 79c016a15..39733a1fe 100644 --- a/weed/mount/inode_to_path.go +++ b/weed/mount/inode_to_path.go @@ -174,10 +174,15 @@ func (i *InodeToPath) RemovePath(path util.FullPath) { } func (i *InodeToPath) removePathFromInode2Path(inode uint64, path util.FullPath) { - if ie, found := i.inode2path[inode]; found { - if ie.removeOnePath(path) && len(ie.paths) == 0 { - delete(i.inode2path, inode) - } + ie, found := i.inode2path[inode] + if !found { + return + } + if !ie.removeOnePath(path) { + return + } + if len(ie.paths) == 0 { + delete(i.inode2path, inode) } } |
