Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3281690lfo; Mon, 23 May 2022 00:37:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4q0NUJ6Zj1Zk64tpUHCk314iFVba0PAyGojXAfahpiIHdEwnzopsFWl/ZNnDsPKQwvAYa X-Received: by 2002:a17:902:e385:b0:161:823d:5309 with SMTP id g5-20020a170902e38500b00161823d5309mr21924513ple.62.1653291421392; Mon, 23 May 2022 00:37:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653291421; cv=none; d=google.com; s=arc-20160816; b=V/gNjMW3f+lceK3EnE7eQMv17xmf4X1rzWQQZtRB3pdTgEIcJGqmSexAlkXVcZApk+ uCEx2+q8+ems4AuECXsxCuM7WnEbYlLJqPabDbCzoH1DNZ47zVSnzytUSGHXLAnNLbE/ t7dPVu9056Gh+3TrDeKfvu6M77ieSWVYBjZ8OVAU0f2fLA5JUKRzvdggb4w3cnbhhKHp rEyKb1jxNwOsdNrSlmN4oaPfNZq8g9DKFqdjQY6cXifuIrwYo0ERNw18yWTz80AVdZoj O5hgbBHyRebdekqMs9TsF//4+QH30JRGrPRN7QOyXqturhZ/JSovpqMnXUehG3swlx7v 26nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=rKDwF3f31MQ9XG3Z00hYY7CcPiUGp4h9v5J/u/8/OsQ=; b=qxzpN/TMzT047OR8gT8Ta3EGnUzOGI5mnHtoJS+n79xZLVyWOu15hGeWUP6yKlmkgi yIandmT2yXfNuWjoK9nenOI5qMOetd67uM9EiwhfutkT0BvMNPzdXrpZfMzU3wdchAp2 6Zb15BI52yHnukV4iJUZCMFV+aVgoXlwO4BNZuUIJXkFB0fgez6p5y/UzWm9g6qchb1+ hiMpZBJ0aU93VfkUigaVOmQbdxsDBq1O4XtANL1Zsy9hYHWn+69S33Fatwd/QLB+lrSU HZPiggcTBSsujPzu7hxZ9MwjXNaGtiZeowMR3oX2+Fy3tlVDned5ua1T54DT413R075A duxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vH5U9BVc; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id mw10-20020a17090b4d0a00b001d988ce2128si14657701pjb.63.2022.05.23.00.37.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 00:37:01 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vH5U9BVc; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 386FA1C9643; Sun, 22 May 2022 23:47:11 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352197AbiETRbv (ORCPT + 99 others); Fri, 20 May 2022 13:31:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237137AbiETRbu (ORCPT ); Fri, 20 May 2022 13:31:50 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5934C60BA0 for ; Fri, 20 May 2022 10:31:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 157C4B82A71 for ; Fri, 20 May 2022 17:31:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11AC8C385A9; Fri, 20 May 2022 17:31:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653067906; bh=lEuAPpH49ZAL8xvh6aePU+pfbu+JAGfsbB+0Xp3O5LU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vH5U9BVcMfslOBDGllyc1uR5srxpm61snyd8KD79TxwamdnxAQY6dYFSJYd6CLTUM msvqdro9xGZRcMh6YgQnjDjvixVbkSFfOGK2WkXBkSfYcl0StygIyFeB+6YCF0rNwp xDsc8txBnndbkSOr4nTSH8f5jKmSF3TsdFeMkGFuvhv7QNOO6PE1qYFzPnndV06Rq2 0yc3Qh9DCs3rVFVPUSE9qXGz+qgTlftdEG9UQEz4NVqS+kQsCpNqEj3NTuvTuv/2Nr i1oL5opLZ3un9oZNbRN8zo5KAacrarjAKPr2J5MTQ7DIeQgujpntkouuNmsKyZxyjV IsSaggEuq8ivw== Date: Fri, 20 May 2022 10:31:44 -0700 From: Nathan Chancellor To: Johannes Berg Cc: Thorsten Leemhuis , Richard Weinberger , Zhen Lei , Jeff Dike , anton ivanov , Andrew Morton , Eduard-Gabriel Munteanu , linux-um , linux-kernel , Nick Desaulniers , regressions Subject: Re: [PATCH 1/1] um: fix error return code in winch_tramp() Message-ID: References: <20210508032239.2177-1-thunder.leizhen@huawei.com> <1b03d888-cea3-3e6f-087f-daeb5642a975@leemhuis.info> <1087614384.239493.1649583213699.JavaMail.zimbra@nod.at> <1287561645.244713.1649702724736.JavaMail.zimbra@nod.at> <32824a71109fe3387d582abbf56601fb08bdc9ef.camel@sipsolutions.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <32824a71109fe3387d582abbf56601fb08bdc9ef.camel@sipsolutions.net> X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 20, 2022 at 07:18:28PM +0200, Johannes Berg wrote: > On Fri, 2022-05-20 at 08:55 -0700, Nathan Chancellor wrote: > > On Fri, May 20, 2022 at 08:08:01AM +0200, Thorsten Leemhuis wrote: > > > On 11.04.22 20:45, Richard Weinberger wrote: > > > > ----- Urspr?ngliche Mail ----- > > > > > Von: "Nathan Chancellor" > > > > > I attempted to print out the error code but it seems like there is no > > > > > output in the console after "reboot: System halted". If I add an > > > > > unconditional print right before the call to os_set_fd_block(), I see it > > > > > during start up but I do not see it during shutdown. Is there some way > > > > > to see that console output during shutdown? > > > > > > > > I think in this case the easiest way is attaching gdb with a breakpoint. > > > > > > I noticed this in my list of open regressions. It seems there wasn't any > > > progress to get this regression fixed (please let me know in case I > > > missed something), but I guess nobody considered it urgent which is > > > likely not that much of a problem in this case. > > > > Yes, sorry, I tried to get gdb to reveal something but I couldn't get it > > to work then I had to move onto other work. We have worked around this > > for the time being but it would still be nice to figure out what is > > going on here; I am just not sure when I am going to have time to > > participate in that process. > > > > This fixes it for me, can you check it? Yes, that works for me as well, thanks for looking into it! Tested-by: Nathan Chancellor > diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c > index 6040817c036f..25727ed648b7 100644 > --- a/arch/um/drivers/chan_user.c > +++ b/arch/um/drivers/chan_user.c > @@ -220,7 +220,7 @@ static int winch_tramp(int fd, struct tty_port *port, int *fd_out, > unsigned long *stack_out) > { > struct winch_data data; > - int fds[2], n, err; > + int fds[2], n, err, pid; > char c; > > err = os_pipe(fds, 1, 1); > @@ -238,8 +238,9 @@ static int winch_tramp(int fd, struct tty_port *port, int *fd_out, > * problem with /dev/net/tun, which if held open by this > * thread, prevents the TUN/TAP device from being reused. > */ > - err = run_helper_thread(winch_thread, &data, CLONE_FILES, stack_out); > - if (err < 0) { > + pid = run_helper_thread(winch_thread, &data, CLONE_FILES, stack_out); > + if (pid < 0) { > + err = pid; > printk(UM_KERN_ERR "fork of winch_thread failed - errno = %d\n", > -err); > goto out_close; > @@ -263,7 +264,7 @@ static int winch_tramp(int fd, struct tty_port *port, int *fd_out, > goto out_close; > } > > - return err; > + return pid; > > out_close: > close(fds[1]); > > > Kind of obvious, really. :) > > johannes