Messages in this thread | | | Date | Sat, 07 Dec 2013 10:20:14 +0900 | From | Masami Hiramatsu <> | Subject | Re: [PATCH v5 1/8] x86: allow to handle errors in text_poke function family |
| |
(2013/12/03 22:21), Petr Mladek wrote: > The text_poke functions called BUG() in case of error. This was too strict. > There are situations when the system is still usable even when the patching > has failed, for example when enabling the dynamic ftrace. > > This commit modifies text_poke, text_poke_early, and text_poke_bp functions > to return an error code instead calling BUG(). The code is returned instead > of the patched address. The address was just copied from the first parameter, > so it was no extra information. It has not been used anywhere yet.
Hmm, this change basically good for me. However, from the maintenance point of view, I'd like to recommend you to introduce some wrappers for them to check return code and just do BUG() instead of changing all call-site, because except for the text_poke_bp, we can not rollback the code safely. (e.g. text_poke() returns an error but text_poke_or_die() just calls BUG when it fails)
Thank you,
-- Masami HIRAMATSU IT Management Research Dept. Linux Technology Center Hitachi, Ltd., Yokohama Research Laboratory E-mail: masami.hiramatsu.pt@hitachi.com
| |