From: Nathan Chancellor <nathan@kernel.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Thorsten Leemhuis <regressions@leemhuis.info>,
Richard Weinberger <richard@nod.at>,
Zhen Lei <thunder.leizhen@huawei.com>,
Jeff Dike <jdike@addtoit.com>,
anton ivanov <anton.ivanov@cambridgegreys.com>,
Andrew Morton <akpm@linux-foundation.org>,
Eduard-Gabriel Munteanu <maxdamage@aladin.ro>,
linux-um <linux-um@lists.infradead.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
regressions <regressions@lists.linux.dev>
Subject: Re: [PATCH 1/1] um: fix error return code in winch_tramp()
Date: Fri, 20 May 2022 10:31:44 -0700 [thread overview]
Message-ID: <YofQgDo38fAnPZEy@dev-arch.thelio-3990X> (raw)
In-Reply-To: <32824a71109fe3387d582abbf56601fb08bdc9ef.camel@sipsolutions.net>
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" <nathan@kernel.org>
> > > > > 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 <nathan@kernel.org>
> 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
prev parent reply other threads:[~2022-05-20 17:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-08 3:22 [PATCH 1/1] um: fix error return code in winch_tramp() Zhen Lei
2021-05-08 9:13 ` Anton Ivanov
2022-03-23 19:41 ` Nathan Chancellor
2022-03-24 12:40 ` Thorsten Leemhuis
2022-04-10 8:41 ` Thorsten Leemhuis
2022-04-10 9:33 ` Richard Weinberger
2022-04-11 17:48 ` Nathan Chancellor
2022-04-11 18:45 ` Richard Weinberger
2022-05-20 6:08 ` Thorsten Leemhuis
2022-05-20 15:55 ` Nathan Chancellor
2022-05-20 17:18 ` Johannes Berg
2022-05-20 17:31 ` Nathan Chancellor [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YofQgDo38fAnPZEy@dev-arch.thelio-3990X \
--to=nathan@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=anton.ivanov@cambridgegreys.com \
--cc=jdike@addtoit.com \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=maxdamage@aladin.ro \
--cc=ndesaulniers@google.com \
--cc=regressions@leemhuis.info \
--cc=regressions@lists.linux.dev \
--cc=richard@nod.at \
--cc=thunder.leizhen@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).