From 28c7bb017c0afd8a0a731bc4c4940476fad073e6 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Wed, 20 Nov 2024 10:14:26 +0100 Subject: [PATCH] cephfs: use os.Remove to remove directory using os.RemoveAll will remove everything in the director after the Umount we should be using os.Remove only to remove the empty directory Signed-off-by: Madhu Rajanna (cherry picked from commit ffa8eaf5ddc3a6f3041bf010f76e7d71c0a08b8d) --- internal/cephfs/nodeserver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cephfs/nodeserver.go b/internal/cephfs/nodeserver.go index a97cc09196b..b3a02ea321c 100644 --- a/internal/cephfs/nodeserver.go +++ b/internal/cephfs/nodeserver.go @@ -636,7 +636,7 @@ func (ns *NodeServer) NodeUnpublishVolume( isMnt = true } if !isMnt { - if err = os.RemoveAll(targetPath); err != nil { + if err = os.Remove(targetPath); err != nil { return nil, status.Error(codes.Internal, err.Error()) }