code: func (ed *emptyDir) setupDir(dir string) error {
  	// Create the directory if it doesn't already exist.
  	if err := os.MkdirAll(dir, perm); err != nil {
  		return err
  	}
  
  	// stat the directory to read permission bits
  	fileinfo, err := os.Lstat(dir)
  	if err != nil {
  		return err
  	}
  
  	if fileinfo.Mode().Perm() != perm.Perm() {
  		// If the permissions on the created directory are wrong, the
  		// kubelet is probably running with a umask set.  In order to
  		// avoid clearing the umask for the entire process or locking
  		// the thread, clearing the umask, creating the dir, restoring
  		// the umask, and unlocking the thread, we do a chmod to set
  		// the specific bits we need.
  		err := os.Chmod(dir, perm)
  		if err != nil {
  			return err
  		}
  
  		fileinfo, err = os.Lstat(dir)
  		if err != nil {
  			return err
  		}
  
  		if fileinfo.Mode().Perm() != perm.Perm() {
  			klog.Errorf("Expected directory %q permissions to be: %s; got: %s", dir, perm.Perm(), fileinfo.Mode().Perm())
  		}
  	}
  
  	return nil
  }
docs: // setupDir creates the directory with the default permissions specified by the perm constant.