code: func (ns NameSpace) stat(ctx context.Context, path string, f func(FileSystem, context.Context, string) (os.FileInfo, error)) (os.FileInfo, error) {
  	var err error
  	for _, m := range ns.resolve(path) {
  		fi, err1 := f(m.fs, ctx, m.translate(path))
  		if err1 == nil {
  			return fi, nil
  		}
  		if err == nil {
  			err = err1
  		}
  	}
  
  	// Check if path is an ancestor dir of a mount point.
  	if err == nil || os.IsNotExist(err) && len(ns) > 0 {
  		for old := range ns {
  			if hasPathPrefix(old, path) && old != path {
  				return dirInfo(pathpkg.Base(path)), nil
  			}
  		}
  	}
  
  	if err == nil {
  		err = &os.PathError{Op: "stat", Path: path, Err: os.ErrNotExist}
  	}
  	return nil, err
  }
docs: // stat implements the FileSystem Stat and Lstat methods.