aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/weedfs_rename.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-02-18 00:45:43 -0800
committerchrislu <chris.lu@gmail.com>2022-02-18 00:45:43 -0800
commitf9d33f70b0529451c583c2fe41685fbe4234069e (patch)
treeaadf1c22f63603e2ff224c150aeac668409bd37a /weed/mount/weedfs_rename.go
parentb9cf4f12fcab2c0fdd35af256faa28f53a414dc2 (diff)
downloadseaweedfs-f9d33f70b0529451c583c2fe41685fbe4234069e.tar.xz
seaweedfs-f9d33f70b0529451c583c2fe41685fbe4234069e.zip
return fuse.Status when looking up by inode
Diffstat (limited to 'weed/mount/weedfs_rename.go')
-rw-r--r--weed/mount/weedfs_rename.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/weed/mount/weedfs_rename.go b/weed/mount/weedfs_rename.go
index 9e461abce..9c83a4b94 100644
--- a/weed/mount/weedfs_rename.go
+++ b/weed/mount/weedfs_rename.go
@@ -145,9 +145,15 @@ func (wfs *WFS) Rename(cancel <-chan struct{}, in *fuse.RenameIn, oldName string
return fuse.EINVAL
}
- oldDir := wfs.inodeToPath.GetPath(in.NodeId)
+ oldDir, code := wfs.inodeToPath.GetPath(in.NodeId)
+ if code != fuse.OK {
+ return
+ }
oldPath := oldDir.Child(oldName)
- newDir := wfs.inodeToPath.GetPath(in.Newdir)
+ newDir, code := wfs.inodeToPath.GetPath(in.Newdir)
+ if code != fuse.OK {
+ return
+ }
newPath := newDir.Child(newName)
glog.V(4).Infof("dir Rename %s => %s", oldPath, newPath)