Skip to content

Commit 49e8060

Browse files
andyzhangxk8s-infra-cherrypick-robot
authored and
k8s-infra-cherrypick-robot
committed
cleanup: refine extensiveMountCheck usage in unmount
1 parent 5d419a3 commit 49e8060

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

pkg/azurefile/azure_common_linux.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ func SMBMount(m *mount.SafeFormatAndMount, source, target, fsType string, option
3333
return m.MountSensitive(source, target, fsType, options, sensitiveMountOptions)
3434
}
3535

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

40-
func CleanupMountPoint(m *mount.SafeFormatAndMount, target string, _ bool) error {
41-
return mount.CleanupMountPoint(target, m.Interface, true /*extensiveMountPointCheck*/)
40+
func CleanupMountPoint(m *mount.SafeFormatAndMount, target string, extensiveMountCheck bool) error {
41+
return mount.CleanupMountPoint(target, m.Interface, extensiveMountCheck)
4242
}
4343

4444
func preparePublishPath(_ string, _ *mount.SafeFormatAndMount) error {

pkg/mounter/safe_mounter_host_process_windows.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,7 @@ func (mounter *winMounter) Unmount(target string) error {
134134
remoteServer, err := smb.GetRemoteServerFromTarget(target)
135135
if err == nil {
136136
klog.V(2).Infof("remote server path: %s, local path: %s", remoteServer, target)
137-
hasDupSMBMount, err := smb.CheckForDuplicateSMBMounts(driverGlobalMountPath, target, remoteServer)
138-
if err == nil {
137+
if hasDupSMBMount, err := smb.CheckForDuplicateSMBMounts(driverGlobalMountPath, target, remoteServer); err == nil {
139138
if !hasDupSMBMount {
140139
remoteServer = strings.Replace(remoteServer, "UNC\\", "\\\\", 1)
141140
if err := smb.RemoveSmbGlobalMapping(remoteServer); err != nil {

0 commit comments

Comments
 (0)