Part of diving with a ceiling (deco or hard) is thinking on your feet, so to speak. How you react is a function of your thought process, your training, and the environment.
One option may have putting some distance between yourself and the rocks, perhaps shooting a bag. If there is heavy...