I don't know how much you know about M42 lens so please forgive me if I state the obvious....
I assume the lens in question is similar to
this lens (it was my lens sold recently).
Please try this:
1. At the rear (near the camera when mounted) of the lens, there is a switch that toggles to show either M or A. Move the switch so that the M is shown (see photo #2 of the eBay listing).
2. Turn the aperture ring. Observe the aperture blades. Do they close/open according to the setting of the aperture ring? If they don't, the lens has a problem.
3. Change the switch setting so that the A is shown.
4. Turn the aperture ring. Observe the aperture blades. Do they close/open according to the setting of the aperture ring? (they should remain fully open).
5. Set the aperture ring to 16, push the little pin at the rear of the lens in. Do you see the aperture blades close down from fully open? (they should).
6. Repeat #5 with different settings of the aperture ring (11, 8, ...).
And report back.
Fortunately, this lens is pretty simple to fix.