Skip to content

Commit

Permalink
Merge pull request #1856 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…1855-to-release-1.30

[release-1.30] cleanup: refine extensiveMountCheck usage in unmount
  • Loading branch information
andyzhangx authored Apr 19, 2024
2 parents 18a7612 + 72015e8 commit 5b31aa3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions pkg/azurefile/azure_common_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ func SMBMount(m *mount.SafeFormatAndMount, source, target, fsType string, option
return m.MountSensitive(source, target, fsType, options, sensitiveMountOptions)
}

func SMBUnmount(m *mount.SafeFormatAndMount, target string, _, _ bool) error {
return mount.CleanupMountPoint(target, m.Interface, true /*extensiveMountPointCheck*/)
func SMBUnmount(m *mount.SafeFormatAndMount, target string, extensiveMountCheck, _ bool) error {
return mount.CleanupMountPoint(target, m.Interface, extensiveMountCheck)
}

func CleanupMountPoint(m *mount.SafeFormatAndMount, target string, _ bool) error {
return mount.CleanupMountPoint(target, m.Interface, true /*extensiveMountPointCheck*/)
func CleanupMountPoint(m *mount.SafeFormatAndMount, target string, extensiveMountCheck bool) error {
return mount.CleanupMountPoint(target, m.Interface, extensiveMountCheck)
}

func preparePublishPath(_ string, _ *mount.SafeFormatAndMount) error {
Expand Down
3 changes: 1 addition & 2 deletions pkg/mounter/safe_mounter_host_process_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ func (mounter *winMounter) Unmount(target string) error {
remoteServer, err := smb.GetRemoteServerFromTarget(target)
if err == nil {
klog.V(2).Infof("remote server path: %s, local path: %s", remoteServer, target)
hasDupSMBMount, err := smb.CheckForDuplicateSMBMounts(driverGlobalMountPath, target, remoteServer)
if err == nil {
if hasDupSMBMount, err := smb.CheckForDuplicateSMBMounts(driverGlobalMountPath, target, remoteServer); err == nil {
if !hasDupSMBMount {
remoteServer = strings.Replace(remoteServer, "UNC\\", "\\\\", 1)
if err := smb.RemoveSmbGlobalMapping(remoteServer); err != nil {
Expand Down

0 comments on commit 5b31aa3

Please sign in to comment.