RE: [PATCH V2] poweroff: fix bug in orderly_poweroff

From: Feng Hong
Date: Thu Sep 20 2012 - 21:49:03 EST


Hi, Serge, Andrew,

Will following an acceptable change log ?

/////////////////////////////////////////////////////////////////////////////////////////////////
orderly_poweroff is trying to poweroff platform by two steps:
step 1: Call user space application to poweroff
step 2: If user space poweroff fail, then do a force power off if force param is set.
The bug here is, step 1 is always successful with param UMH_NO_WAIT, which obey
the design goal of orderly_poweroff.

We have two choices here:
UMH_WAIT_EXEC which means wait for the exec, but not the process;
UMH_WAIT_PROC which means wait for the process to complete.
we need to trade off the two choices:

If using UMH_WAIT_EXEC, there is potential issue comments by Serge E. Hallyn: The exec will
have started, but may for whatever (very unlikely) reason fail.

If using UMH_WAIT_PROC, there is potential issue comments by Eric W. Biederman: If the caller
is not running in a kernel thread then we can easily get into a case where the user space caller
will block waiting for us when we are waiting for the user space caller.

Thanks for their excellent ideas, based on the above discussion, we finally choose UMH_WAIT_EXEC,
which is much more safe, if the user application really fails, we just complain the application
itself, it seems a better choice here.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

--
Best Regards,
Feng Hong
Application Processor Software Engnieer
Marvell Technology (Shanghai) Ltd


-----Original Message-----
From: Andrew Morton [mailto:akpm@xxxxxxxxxxxxxxxxxxxx]
Sent: 2012年9月21日 8:25
To: Feng Hong
Cc: Serge E. Hallyn; gorcunov@xxxxxxxxxx; keescook@xxxxxxxxxxxx; serge.hallyn@xxxxxxxxxxxxx; ebiederm@xxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
Subject: Re: [PATCH V2] poweroff: fix bug in orderly_poweroff

On Thu, 20 Sep 2012 17:16:35 -0700
Feng Hong <hongfeng@xxxxxxxxxxx> wrote:

> I am just a graduate and it's my first time to send a patch to
> opensource, so thank you very much for reminding me the "changelog
> affairs", it seems this patch has been added to -mm tree as attached
> mail, and I have no chance to change the comments, right ? Then I must
> remember this and be careful next time. Thanks again for reminding me!

It depends. If the person who committed the patch was using a git tree
then it can be difficult for them to alter a changelog.

But the -mm tree is not mastered in git (for this and other reasons),
and I alter changelogs all the time. So please feel free to send
replacement text and I shall copy-n-paste that text straight into the patch.

韬{.n?????%?lzwm?b?Р骒r?zXЩ??{ay????j?f"?????ア?⒎?:+v???????赙zZ+????"?!?O???v??m?鹈 n?帼Y&—