public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Eryu Guan <guaneryu@gmail.com>
To: ZhangXiaoxu <zhangxiaoxu5@huawei.com>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH] generic/478: should wait until dup success or fail
Date: Sun, 14 Apr 2019 19:04:51 +0800	[thread overview]
Message-ID: <20190414110451.GM2824@desktop> (raw)
In-Reply-To: <1554975321-121948-1-git-send-email-zhangxiaoxu5@huawei.com>

On Thu, Apr 11, 2019 at 05:35:21PM +0800, ZhangXiaoxu wrote:
> When test on nfs, maybe failed as below:
>   wait sem0 0: Resource temporarily unavailable
>   set sem0 0: Invalid argument
>   exit rmid: Invalid argument
> 
> It means getlk routine wait sem0 timeout, because the setlk routine
> maybe take too long time on ‘fcntl’ or 'dup'.
> 
> So, let wait on sem0 in getlk routine until the setlk routine success
> or fail.
> 
> Signed-off-by: ZhangXiaoxu <zhangxiaoxu5@huawei.com>
> ---
>  src/t_ofd_locks.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/src/t_ofd_locks.c b/src/t_ofd_locks.c
> index e3b15dd..32e90c0 100644
> --- a/src/t_ofd_locks.c
> +++ b/src/t_ofd_locks.c
> @@ -414,9 +414,7 @@ int main(int argc, char **argv)
>  		sop.sem_num = 0;
>  		sop.sem_op = 0;
>  		sop.sem_flg = 0;
> -		ts.tv_sec = 5;
> -		ts.tv_nsec = 0;
> -		if (semtimedop(semid, &sop, 1, &ts) == -1)
> +		if (semtimedop(semid, &sop, 1, NULL) == -1)

We set a timeout value on purpose in the first place, to avoid hanging
the whole test if the setlk process went wrong.

And I didn't reproduce it on NFS. Do I need any special NFS
configuration?

Thanks,
Eryu

>  			err_exit("wait sem0 0", errno);
>  
>  		if (fcntl(fd, getlk_macro, &flk) < 0)
> -- 
> 2.7.4
> 

      reply	other threads:[~2019-04-14 11:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11  9:35 [PATCH] generic/478: should wait until dup success or fail ZhangXiaoxu
2019-04-14 11:04 ` Eryu Guan [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=20190414110451.GM2824@desktop \
    --to=guaneryu@gmail.com \
    --cc=fstests@vger.kernel.org \
    --cc=zhangxiaoxu5@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