Peeling texture layer was discovered during a ceiling fan installation, probably due to the ingress of moist air from the attic through the cracks around the old electrical box. All loose material was removed from ceiling, gaps between the box and the drywall caulked for air-tightness, then the area was taped and patched, sanded smooth, and sprayed with matching knockdown texture. All ready for the new fan!