In this paper we show that the geodesic flow of a Finsler metric is Anosov if and only if there exists a C 2 open neighborhood of Finsler metrics all of whose closed geodesics are hyperbolic. For surfaces this result holds also for Riemannian metrics. This follows from a recent result of Contreras and Mazzucchelli [Duke Math. J. 173 (2024), pp. 347-390]. Furthermore, geodesic flows of Riemannian or Finsler metrics on surfaces are C 2 stably ergodic if and only if they are Anosov.