From 70a5b71c4ab62a73414ab8fe8dc5abb252622203 Mon Sep 17 00:00:00 2001 From: David White Date: Fri, 10 Feb 2023 16:49:21 -0700 Subject: [PATCH] fix: Do not run filesystem checks if fs is already mounted In order to meet idempotency requirements, don't run (and fail) FS checks on an already mounted filesystem in NodePublishVolume --- pkg/storage/storageService.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/storage/storageService.go b/pkg/storage/storageService.go index 4579dbb0..b99259a7 100644 --- a/pkg/storage/storageService.go +++ b/pkg/storage/storageService.go @@ -113,6 +113,12 @@ func RemoveGatekeeper(volumeName string) { // CheckFs: Perform a file system validation func CheckFs(path string, fstype string, context string) error { + + if IsVolumeInUse(path) { + klog.Infof("Volume already mounted, not performing FS check") + return nil + } + fsRepairCommand := "e2fsck" if fstype == "xfs" { fsRepairCommand = "xfs_repair"