code: func (b *storageosUnmounter) TearDown() error {
  	if len(b.volNamespace) == 0 || len(b.volName) == 0 {
  		klog.Warningf("volNamespace: %q, volName: %q not set, skipping TearDown", b.volNamespace, b.volName)
  		return fmt.Errorf("pvName not specified for TearDown, waiting for next sync loop")
  	}
  	// Unmount from pod
  	mountPath := b.GetPath()
  
  	err := b.TearDownAt(mountPath)
  	if err != nil {
  		klog.Errorf("Unmount from pod failed: %v", err)
  		return err
  	}
  
  	// Find device name from global mount
  	globalPDPath := makeGlobalPDName(b.plugin.host, b.pvName, b.volNamespace, b.volName)
  	devicePath, _, err := mount.GetDeviceNameFromMount(b.mounter, globalPDPath)
  	if err != nil {
  		klog.Errorf("Detach failed when getting device from global mount: %v", err)
  		return err
  	}
  
  	// Unmount from plugin's disk global mount dir.
  	err = b.TearDownAt(globalPDPath)
  	if err != nil {
  		klog.Errorf("Detach failed during unmount: %v", err)
  		return err
  	}
  
  	// Detach loop device
  	err = b.manager.DetachVolume(b, devicePath)
  	if err != nil {
  		klog.Errorf("Detach device %s failed for volume %s: %v", devicePath, b.pvName, err)
  		return err
  	}
  
  	klog.V(4).Infof("Successfully unmounted StorageOS volume %s and detached devices", b.pvName)
  
  	return nil
  }
docs: // Unmounts the bind mount, and detaches the disk only if the PD
  // resource was the last reference to that disk on the kubelet.