public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 3/3] netstress.c: convert to new library API
Date: Mon, 23 Jan 2017 15:57:34 +0100	[thread overview]
Message-ID: <20170123145734.GC25788@rei.lan> (raw)
In-Reply-To: <1482154595-4641-3-git-send-email-alexey.kodanev@oracle.com>

Hi!
>  	shutdown(*fd, SHUT_WR);
> -	SAFE_CLOSE(cleanup, *fd);
> +	SAFE_CLOSE(*fd);
>  	*fd = -1;

FYI the SAFE_CLOSE() already sets fd to -1.

Otherwise it looks pretty much straightforward. I was concerned about
the cleanup, i.e. if the rest of the threads should be stopped before we
run it, but it looks like the worst case is 'use after free' in the
short period after of the threads enters cleanup via tst_brk() and
before it calls exit(), which does not sound that bad considering
something has failed anyway since we are most likely exitting with TBROK.

In short, acked.

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2017-01-23 14:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-19 13:36 [LTP] [PATCH 1/3] tst_test: add tst_parse_long() Alexey Kodanev
2016-12-19 13:36 ` [LTP] [PATCH 2/3] tst_test: add macro helper to invoke pthread_once() Alexey Kodanev
2017-01-23 14:58   ` Cyril Hrubis
2016-12-19 13:36 ` [LTP] [PATCH 3/3] netstress.c: convert to new library API Alexey Kodanev
2017-01-23 14:57   ` Cyril Hrubis [this message]
2017-01-27 14:07     ` Alexey Kodanev
2017-01-30 13:13       ` Cyril Hrubis
2017-01-30 13:32         ` Alexey Kodanev
2017-01-23 14:26 ` [LTP] [PATCH 1/3] tst_test: add tst_parse_long() 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=20170123145734.GC25788@rei.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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