code: func (m *csiBlockMapper) TearDownDevice(globalMapPath, devicePath string) error {
  	if !m.plugin.blockEnabled {
  		return errors.New("CSIBlockVolume feature not enabled")
  	}
  
  	klog.V(4).Infof(log("unmapper.TearDownDevice(globalMapPath=%s; devicePath=%s)", globalMapPath, devicePath))
  
  	ctx, cancel := context.WithTimeout(context.Background(), csiTimeout)
  	defer cancel()
  
  	csiClient, err := m.csiClientGetter.Get()
  	if err != nil {
  		klog.Error(log("blockMapper.TearDownDevice failed to get CSI client: %v", err))
  		return err
  	}
  
  	// Call NodeUnpublishVolume
  	publishPath := m.getPublishPath()
  	if _, err := os.Stat(publishPath); err != nil {
  		if os.IsNotExist(err) {
  			klog.V(4).Infof(log("blockMapper.TearDownDevice publishPath(%s) has already been deleted, skip calling NodeUnpublishVolume", publishPath))
  		} else {
  			return err
  		}
  	} else {
  		err := m.unpublishVolumeForBlock(ctx, csiClient, publishPath)
  		if err != nil {
  			return err
  		}
  	}
  
  	// Call NodeUnstageVolume
  	stagingPath := m.getStagingPath()
  	if _, err := os.Stat(stagingPath); err != nil {
  		if os.IsNotExist(err) {
  			klog.V(4).Infof(log("blockMapper.TearDownDevice stagingPath(%s) has already been deleted, skip calling NodeUnstageVolume", stagingPath))
  		} else {
  			return err
  		}
  	} else {
  		err := m.unstageVolumeForBlock(ctx, csiClient, stagingPath)
  		if err != nil {
  			return err
  		}
  	}
  
  	return nil
  }
docs: // TearDownDevice removes traces of the SetUpDevice.