Always be carrying. Even a 22 snub would help.
For those disinclined or unable to carry:
Fire extinguishers, aimed into the mouth and/or nose to obstruct breathing, thus causing the dog to open the mouth, have been found to be almost as effective as firearms in stopping an attack.
Not sure if foam or powder (b or c-type) would be most effective, but it would be less likely to hit someone else.
This breed-type has been found in some attacks to be almost impervious to pain; and so pepper spray and tear gas sometimes are not effective.
Speer Gold Dot, Personal Protection, WMR 40gr, for short barrels.
For us, it’s a drywall hatchet hammer. Long handle. 28 ounce cast iron head, hammer on one side, hatchet edge sharper than Satan’s Teeth on the other. You know, for up close and personal exchanges. Dogs are particularly sensitive to pain just behind the muscle mass on the front shoulders. Jamming a thumb into that spot drops a dog stone cold. Hit them there with a hammer and they are not getting up anytime soon. If that has not been the result, flip the hatchet over and slice away.