From: Cyril Hrubis <chrubis@suse.cz>
To: Martin Doucha <mdoucha@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] pty/pty07: Restore active console after the testrun
Date: Fri, 11 Mar 2022 11:06:25 +0100 [thread overview]
Message-ID: <YisfIWsrgxVt8xc2@yuki> (raw)
In-Reply-To: <8378e9dd-31a5-b39e-36cc-f3d3a1d41345@suse.cz>
Hi!
> > static void cleanup(void)
> > {
> > - tst_fzsync_pair_cleanup(&fzp);
> > - if (fd >= 0)
> > + if (fd >= 0) {
> > + tst_res(TINFO, "Restoring active console");
> > + SAFE_IOCTL(fd, VT_ACTIVATE, vt_active);
> > SAFE_CLOSE(fd);
> > + }
> > +
> > + tst_fzsync_pair_cleanup(&fzp);
>
> If you move the fzsync cleanup to the end of cleanup(), you can end up
> with the open_close() thread racing against fd cleanup.
Ah, right, looking closely at the fzsync, the thread B may be racing
against the restoration in the case that something caused premature exit
in the thread A.
Will move the call back to the start of the cleanup().
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-03-11 10:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-11 9:51 [LTP] [PATCH] pty/pty07: Restore active console after the testrun Cyril Hrubis
2022-03-11 9:56 ` Martin Doucha
2022-03-11 10:06 ` Cyril Hrubis [this message]
2022-03-22 8:13 ` Richard Palethorpe
2022-03-22 9:34 ` Cyril Hrubis
2022-03-22 11:41 ` Richard Palethorpe
2022-03-22 12:05 ` Cyril Hrubis
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=YisfIWsrgxVt8xc2@yuki \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
--cc=mdoucha@suse.cz \
/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