Automatically recovering after storage failures