From 9832653e1d3c6a4382b12ce5ccd55f2374bddeb6 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 8 Aug 2020 21:37:36 -0700 Subject: [PATCH] FUSE mount: proper error with deleting non empty folder --- weed/filesys/dir.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go index 2214b1ac7..843ada866 100644 --- a/weed/filesys/dir.go +++ b/weed/filesys/dir.go @@ -334,7 +334,10 @@ func (dir *Dir) removeFolder(req *fuse.RemoveRequest) error { glog.V(3).Infof("remove directory entry: %v", req) err := filer_pb.Remove(dir.wfs, dir.FullPath(), req.Name, true, false, false, false) if err != nil { - glog.V(3).Infof("not found remove %s/%s: %v", dir.FullPath(), req.Name, err) + glog.V(3).Infof("remove %s/%s: %v", dir.FullPath(), req.Name, err) + if strings.Contains(err.Error(), "non-empty"){ + return fuse.EEXIST + } return fuse.ENOENT }