I recently traveled from USA to India with a layover in London (British Airways). I had locked each one of my check-in luggage with a TSA lock. One of my luggage bags seems to have been opened for inspection. I suspect this because I checked the keyhole of the lock and it looked different from the other locks. Also, this lock is always unlocked irrespective of whether I entered the correct combination or not. How do I fix such a lock?
It is likely the TSA or other customs/inspections agent broke the lock when opening your luggage. Even though the whole point of the "TSA-Lock" is that they have master keys, they sometimes are too lazy and just clip (cut) the lock or they use the wrong master key and force the lock, breaking it. It doesn't help that many TSA locks are very poorly constructed. Fortunately, that also means they are inexpensive.
While a locksmith may be able to repair it, it is almost always cheaper to just get a new lock.
Or do what most experienced travellers do and simply use a ziptie. You can buy 100 of them for 1 euro/dollar. Simple to use and just as much of a deterrent as the TSA lock.
You said "seems to have been opened", was there a piece of paper from TSA in your suitcase stating that it had been opened for inspection? If there is no paper, then your suitcase was likely tampered with by someone else and they could have been at any of the three airports you traveled through.
Padlocks for the most part are not worth repairing, it is easier and more economical to simply buy a new lock. Or not even bother locking at all.
There is one school of thought on locks, that putting a lock on a suitcase signals to the would be thief that there is greater potential for valuable items in that suitcase. And an unlocked suitcase has nothing of value.