vfs: call stat only when it's needed

we do call stat even if the result of it will be ignored.

Acked-by: Gerd Behrmann
Target: master