Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-1.28] cleanup: refine extensiveMountCheck usage in unmount #1857

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -143,8 +143,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
Loading