aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-02-18 01:10:53 -0800
committerchrislu <chris.lu@gmail.com>2022-02-18 01:10:53 -0800
commit63062ed7f0c59061954cf2c263fb0e6ea93d5429 (patch)
tree406dce10dcbe2dd36a0988b6d2d27d17bc85858d
parent93e12d5f302b5aa350f842867d422878ba3da4e6 (diff)
downloadseaweedfs-63062ed7f0c59061954cf2c263fb0e6ea93d5429.tar.xz
seaweedfs-63062ed7f0c59061954cf2c263fb0e6ea93d5429.zip
mount2: fix unlink
-rw-r--r--weed/mount/weedfs_file_mkrm.go16
1 files changed, 11 insertions, 5 deletions
diff --git a/weed/mount/weedfs_file_mkrm.go b/weed/mount/weedfs_file_mkrm.go
index 9e19c8b54..243696dba 100644
--- a/weed/mount/weedfs_file_mkrm.go
+++ b/weed/mount/weedfs_file_mkrm.go
@@ -104,13 +104,19 @@ func (wfs *WFS) Unlink(cancel <-chan struct{}, header *fuse.InHeader, name strin
dirFullPath, code := wfs.inodeToPath.GetPath(header.NodeId)
if code != fuse.OK {
- return
+ if code == fuse.ENOENT {
+ return fuse.OK
+ }
+ return code
}
entryFullPath := dirFullPath.Child(name)
- entry, status := wfs.maybeLoadEntry(entryFullPath)
- if status != fuse.OK {
- return status
+ entry, code := wfs.maybeLoadEntry(entryFullPath)
+ if code != fuse.OK {
+ if code == fuse.ENOENT {
+ return fuse.OK
+ }
+ return code
}
// first, ensure the filer store can correctly delete
@@ -119,7 +125,7 @@ func (wfs *WFS) Unlink(cancel <-chan struct{}, header *fuse.InHeader, name strin
err := filer_pb.Remove(wfs, string(dirFullPath), name, isDeleteData, false, false, false, []int32{wfs.signature})
if err != nil {
glog.V(0).Infof("remove %s: %v", entryFullPath, err)
- return fuse.ENOENT
+ return fuse.OK
}
// then, delete meta cache