How important is it to repair plaster before repainting?

Our ceilings have peeling paint that we're pretty sure was caused by past water damage.

Since the water problem is no longer an issue, can we simply repaint the ceilings or should we first repair any underlying plaster damage?