All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] generic/478: should wait until dup success or fail
@ 2019-04-11  9:35 ZhangXiaoxu
  2019-04-14 11:04 ` Eryu Guan
  0 siblings, 1 reply; 2+ messages in thread
From: ZhangXiaoxu @ 2019-04-11  9:35 UTC (permalink / raw)
  To: guaneryu, fstests, zhangxiaoxu5

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-14 11:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-11  9:35 [PATCH] generic/478: should wait until dup success or fail ZhangXiaoxu
2019-04-14 11:04 ` Eryu Guan

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.