Thread (43 messages) 43 messages, 5 authors, 2020-07-03

Re: linux-next: umh: fix processed error when UMH_WAIT_PROC is used seems to break linux bridge on s390x (bisected)

From: Christoph Hellwig <hch@infradead.org>
Date: 2020-06-26 09:01:18
Also in: bridge, keyrings, linux-fsdevel, linux-nfs, linux-s390, lkml, netdev

On Fri, Jun 26, 2020 at 07:22:34AM +0200, Christian Borntraeger wrote:

On 26.06.20 04:54, Luis Chamberlain wrote:
quoted
On Wed, Jun 24, 2020 at 08:37:55PM +0200, Christian Borntraeger wrote:
quoted

On 24.06.20 20:32, Christian Borntraeger wrote:
[...]> 
quoted
So the translations look correct. But your change is actually a sematic change
if(ret) will only trigger if there is an error
if (KWIFEXITED(ret)) will always trigger when the process ends. So we will always overwrite -ECHILD
and we did not do it before. 
So the right fix is
diff --git a/kernel/umh.c b/kernel/umh.c
index f81e8698e36e..a3a3196e84d1 100644
--- a/kernel/umh.c
+++ b/kernel/umh.c
@@ -154,7 +154,7 @@ static void call_usermodehelper_exec_sync(struct subprocess_info *sub_info)
                 * the real error code is already in sub_info->retval or
                 * sub_info->retval is 0 anyway, so don't mess with it then.
                 */
-               if (KWIFEXITED(ret))
+               if (KWEXITSTATUS(ret))
                        sub_info->retval = KWEXITSTATUS(ret);
        }
 
I think.
Nope, the right form is to check for WIFEXITED() before using WEXITSTATUS().
But this IS a change over the previous code, no?
I will test next week as I am travelling right now. 
I'm all for reverting back to the previous behavior.  If someone wants
a behavior change it should be a separate patch.  And out of pure self
interest I'd like to see that change after my addition of the
kernel_wait helper to replace the kernel_wait4 abuse :)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help