code: func rootPath(root, path string, cb onSymlinkFunc) (string, error) {
  	if path == "" {
  		return root, nil
  	}
  	var linksWalked int // to protect against cycles
  	for {
  		i := linksWalked
  		newpath, err := walkLinks(root, path, &linksWalked, cb)
  		if err != nil {
  			return "", err
  		}
  		path = newpath
  		if i == linksWalked {
  			newpath = filepath.Join("/", newpath)
  			if path == newpath {
  				return filepath.Join(root, newpath), nil
  			}
  			path = newpath
  		}
  	}
  }
docs: // rootPath joins a path with a root, evaluating and bounding any
  // symlink to the root directory.
  // This is containerd/continuity/fs RootPath implementation with a callback on
  // resolving the symlink.