All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Kodanev <alexey.kodanev@oracle.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscall/fcntl33.c: fix test on FUSE fs
Date: Wed, 20 Apr 2016 13:55:38 +0300	[thread overview]
Message-ID: <5717602A.1020400@oracle.com> (raw)
In-Reply-To: <20160419180151.GE21282@rei.lan>

Hi,
On 19.04.2016 21:01, Cyril Hrubis wrote:
>   
>   static void do_test(int i)
>   {
> -	pid_t cpid;
> +	fd = SAFE_OPEN(cleanup, "file", O_RDONLY);
> +
> +	pid_t cpid = tst_fork();
>   
> -	cpid = tst_fork();
>   	if (cpid < 0)
>   		tst_brkm(TBROK | TERRNO, cleanup, "fork() failed");
>   
> -	if (cpid == 0)
> +	if (cpid == 0) {
> +		SAFE_CLOSE(NULL, fd);
>   		do_child(i);
> -
> -	fd = SAFE_OPEN(cleanup, "file", O_RDONLY);
> +	}
> Looks good.
>
> Another possible solution would be to use checkpoints and wait in the
> child before we call tst_process_state_wait() and wake it up from parent
> just before we call the fcntl(). But that would be more complicated than
> this.

Yes, it would be a more portable alternative instead of waiting for a 
sleep state in a child.

Applied the original patch which has a simpler fix.

Thanks,
Alexey



      reply	other threads:[~2016-04-20 10:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-19 17:17 [LTP] [PATCH] syscall/fcntl33.c: fix test on FUSE fs Alexey Kodanev
2016-04-19 18:01 ` Cyril Hrubis
2016-04-20 10:55   ` Alexey Kodanev [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=5717602A.1020400@oracle.com \
    --to=alexey.kodanev@oracle.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.