aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-01-24 14:21:50 -0800
committerchrislu <chris.lu@gmail.com>2022-01-24 14:21:50 -0800
commit7328962009f301a4c7d5d6f4c2107841d62c5441 (patch)
tree84fec92173872419ac8b502a28d7d91e9e04a3c6
parent3bba2124ef346e90f6f2b5378ad6ce63c7f2226e (diff)
downloadseaweedfs-7328962009f301a4c7d5d6f4c2107841d62c5441.tar.xz
seaweedfs-7328962009f301a4c7d5d6f4c2107841d62c5441.zip
revert "POSIX: should not delete if a directory is not empty"
revert 0c75f15062c931d457fb52a079ca22fbb4679247 Reported: Hi, about commit: 0c75f15062c931d457fb52a079ca22fbb4679247 POSIX: should not delete if a directory is not empty It should still delete with a command like rm -rf "${path}"/ because it is a forced delete, but now it gets fail to delete non-empty folder: [...] Can you enable the delete if it is forced?
-rw-r--r--weed/filesys/dir.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go
index 96ca4fcac..b40addfe7 100644
--- a/weed/filesys/dir.go
+++ b/weed/filesys/dir.go
@@ -491,8 +491,8 @@ func (dir *Dir) removeFolder(entry *filer_pb.Entry, req *fuse.RemoveRequest) err
dirFullPath := dir.FullPath()
glog.V(3).Infof("remove directory entry: %v", req)
- ignoreRecursiveErr := false // ignore recursion error since the OS should manage it
- err := filer_pb.Remove(dir.wfs, dirFullPath, req.Name, true, false, ignoreRecursiveErr, false, []int32{dir.wfs.signature})
+ ignoreRecursiveErr := true // ignore recursion error since the OS should manage it
+ err := filer_pb.Remove(dir.wfs, dirFullPath, req.Name, true, true, ignoreRecursiveErr, false, []int32{dir.wfs.signature})
if err != nil {
glog.V(0).Infof("remove %s/%s: %v", dirFullPath, req.Name, err)
if strings.Contains(err.Error(), filer.MsgFailDelNonEmptyFolder) {