Re: [PATCH v5 1/8] x86: allow to handle errors in text_poke functionfamily

From: Masami Hiramatsu
Date: Fri Dec 06 2013 - 20:20:29 EST


(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@xxxxxxxxxxx


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/