From a6239d23e0233c98ba841d5aa63c816ffe62838d Mon Sep 17 00:00:00 2001 From: Vignesh Laxman <123447282+vlaxman-px@users.noreply.github.com> Date: Fri, 12 Jul 2024 12:16:35 +0530 Subject: [PATCH] Revert "PWX-33580 Run stat command with timeout during NFS Unmount (#2403) (#2457)" (#2458) This reverts commit 0ba1aa1e2a52c2c3d596cb51e404f95b4562bbf5. Signed-off-by: Vignesh Laxman --- pkg/mount/mount.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pkg/mount/mount.go b/pkg/mount/mount.go index 6cc0095f6..3facb35cf 100644 --- a/pkg/mount/mount.go +++ b/pkg/mount/mount.go @@ -4,14 +4,12 @@ package mount import ( - "context" "crypto/md5" "encoding/hex" "errors" "fmt" "io/ioutil" "os" - "os/exec" "path" "path/filepath" "regexp" @@ -104,7 +102,6 @@ const ( mountPathRemoveDelay = 30 * time.Second testDeviceEnv = "Test_Device_Mounter" bindMountPrefix = "readonly" - statTimeout = 30 * time.Second ) var ( @@ -728,11 +725,7 @@ func (m *Mounter) removeMountPath(path string) error { // RemoveMountPath makes the path writeable and removes it after a fixed delay func (m *Mounter) RemoveMountPath(mountPath string, opts map[string]string) error { - ctx, cancel := context.WithTimeout(context.Background(), statTimeout) - defer cancel() - cmd := exec.CommandContext(ctx, "stat", mountPath) - _, err := cmd.CombinedOutput() - if err == nil { + if _, err := os.Stat(mountPath); err == nil { if options.IsBoolOptionSet(opts, options.OptionsWaitBeforeDelete) { hasher := md5.New() hasher.Write([]byte(mountPath))