public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] aio_fsync: wait until aio_fsync completes
@ 2013-08-12 11:03 Jan Stancek
  2013-08-12 12:07 ` chrubis
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jan Stancek @ 2013-08-12 11:03 UTC (permalink / raw)
  To: ltp-list

This patch introduces wait so that testcases exit doesn't race
with completion of aio_fsync.

This is to avoid SIGSEGV:
 #0  0x000003fffd1f4a24 in _IO_flush_all_lockp () at genops.c:850
 #1  0x000003fffd1f4b8e in _IO_cleanup () at genops.c:1010
 #2  0x000003fffd1a88f6 in __run_exit_handlers () at exit.c:90
 #3  0x000003fffd1a89b0 in __GI_exit () at exit.c:99
 #4  0x000003fffd18c822 in __libc_start_main () at libc-start.c:292
 #5  0x0000000080000b76 in _start ()

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 .../conformance/interfaces/aio_fsync/8-1.c         |   14 ++++++++++++++
 .../conformance/interfaces/aio_fsync/8-2.c         |   14 ++++++++++++++
 .../conformance/interfaces/aio_fsync/8-3.c         |   14 ++++++++++++++
 .../conformance/interfaces/aio_fsync/8-4.c         |   14 ++++++++++++++
 .../conformance/interfaces/aio_fsync/9-1.c         |   14 ++++++++++++++
 5 files changed, 70 insertions(+), 0 deletions(-)

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-1.c
index d03dc76..356a21e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-1.c
@@ -73,6 +73,20 @@ int main(void)
 		exit(PTS_FAIL);
 	}
 
+	/* wait for aio_fsync */
+	do {
+		usleep(10000);
+		ret = aio_error(&aiocb_fsync);
+	} while (ret == EINPROGRESS);
+
+	ret = aio_return(&aiocb_fsync);
+	if (ret) {
+		printf(TNAME " Error at aio_return(): %d (%s)\n",
+			ret, strerror(errno));
+		close(fd);
+		return PTS_FAIL;
+	}
+
 	close(fd);
 	printf("Test PASSED\n");
 	return PTS_PASS;
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-2.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-2.c
index 7215872..65e36d0 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-2.c
@@ -73,6 +73,20 @@ int main(void)
 		exit(PTS_FAIL);
 	}
 
+	/* wait for aio_fsync */
+	do {
+		usleep(10000);
+		ret = aio_error(&aiocb_fsync);
+	} while (ret == EINPROGRESS);
+
+	ret = aio_return(&aiocb_fsync);
+	if (ret) {
+		printf(TNAME " Error at aio_return(): %d (%s)\n",
+			ret, strerror(errno));
+		close(fd);
+		return PTS_FAIL;
+	}
+
 	close(fd);
 	printf("Test PASSED\n");
 	return PTS_PASS;
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-3.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-3.c
index 1126e84..794ee49 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-3.c
@@ -73,6 +73,20 @@ int main(void)
 		exit(PTS_FAIL);
 	}
 
+	/* wait for aio_fsync */
+	do {
+		usleep(10000);
+		ret = aio_error(&aiocb_fsync);
+	} while (ret == EINPROGRESS);
+
+	ret = aio_return(&aiocb_fsync);
+	if (ret) {
+		printf(TNAME " Error at aio_return(): %d (%s)\n",
+			ret, strerror(errno));
+		close(fd);
+		return PTS_FAIL;
+	}
+
 	close(fd);
 	printf("Test PASSED\n");
 	return PTS_PASS;
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-4.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-4.c
index e0e83a7..7a212e6 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-4.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-4.c
@@ -73,6 +73,20 @@ int main(void)
 		exit(PTS_FAIL);
 	}
 
+	/* wait for aio_fsync */
+	do {
+		usleep(10000);
+		ret = aio_error(&aiocb_fsync);
+	} while (ret == EINPROGRESS);
+
+	ret = aio_return(&aiocb_fsync);
+	if (ret) {
+		printf(TNAME " Error at aio_return(): %d (%s)\n",
+			ret, strerror(errno));
+		close(fd);
+		return PTS_FAIL;
+	}
+
 	close(fd);
 	printf("Test PASSED\n");
 	return PTS_PASS;
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/9-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/9-1.c
index f0e7ee2..a8b0ec1 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/9-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/9-1.c
@@ -72,6 +72,20 @@ int main(void)
 		exit(PTS_FAIL);
 	}
 
+	/* wait for aio_fsync */
+	do {
+		usleep(10000);
+		ret = aio_error(&aiocb_fsync);
+	} while (ret == EINPROGRESS);
+
+	ret = aio_return(&aiocb_fsync);
+	if (ret) {
+		printf(TNAME " Error at aio_return(): %d (%s)\n",
+			ret, strerror(errno));
+		close(fd);
+		return PTS_FAIL;
+	}
+
 	close(fd);
 	printf("Test PASSED\n");
 	return PTS_PASS;
-- 
1.7.1


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] aio_fsync: wait until aio_fsync completes
  2013-08-12 11:03 [LTP] [PATCH] aio_fsync: wait until aio_fsync completes Jan Stancek
@ 2013-08-12 12:07 ` chrubis
  2013-08-20  6:52 ` Wanlong Gao
  2013-08-21  6:35 ` Wanlong Gao
  2 siblings, 0 replies; 4+ messages in thread
From: chrubis @ 2013-08-12 12:07 UTC (permalink / raw)
  To: Jan Stancek; +Cc: ltp-list

Hi!
> This is to avoid SIGSEGV:
>  #0  0x000003fffd1f4a24 in _IO_flush_all_lockp () at genops.c:850
>  #1  0x000003fffd1f4b8e in _IO_cleanup () at genops.c:1010
>  #2  0x000003fffd1a88f6 in __run_exit_handlers () at exit.c:90
>  #3  0x000003fffd1a89b0 in __GI_exit () at exit.c:99
>  #4  0x000003fffd18c822 in __libc_start_main () at libc-start.c:292
>  #5  0x0000000080000b76 in _start ()
> 
> Signed-off-by: Jan Stancek <jstancek@redhat.com>

Acked.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] aio_fsync: wait until aio_fsync completes
  2013-08-12 11:03 [LTP] [PATCH] aio_fsync: wait until aio_fsync completes Jan Stancek
  2013-08-12 12:07 ` chrubis
@ 2013-08-20  6:52 ` Wanlong Gao
  2013-08-21  6:35 ` Wanlong Gao
  2 siblings, 0 replies; 4+ messages in thread
From: Wanlong Gao @ 2013-08-20  6:52 UTC (permalink / raw)
  To: Jan Stancek; +Cc: ltp-list

On 08/12/2013 07:03 PM, Jan Stancek wrote:
> This patch introduces wait so that testcases exit doesn't race
> with completion of aio_fsync.
> 
> This is to avoid SIGSEGV:
>  #0  0x000003fffd1f4a24 in _IO_flush_all_lockp () at genops.c:850
>  #1  0x000003fffd1f4b8e in _IO_cleanup () at genops.c:1010
>  #2  0x000003fffd1a88f6 in __run_exit_handlers () at exit.c:90
>  #3  0x000003fffd1a89b0 in __GI_exit () at exit.c:99
>  #4  0x000003fffd18c822 in __libc_start_main () at libc-start.c:292
>  #5  0x0000000080000b76 in _start ()
> 
> Signed-off-by: Jan Stancek <jstancek@redhat.com>

Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>


------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] aio_fsync: wait until aio_fsync completes
  2013-08-12 11:03 [LTP] [PATCH] aio_fsync: wait until aio_fsync completes Jan Stancek
  2013-08-12 12:07 ` chrubis
  2013-08-20  6:52 ` Wanlong Gao
@ 2013-08-21  6:35 ` Wanlong Gao
  2 siblings, 0 replies; 4+ messages in thread
From: Wanlong Gao @ 2013-08-21  6:35 UTC (permalink / raw)
  To: Jan Stancek; +Cc: ltp-list

On 08/12/2013 07:03 PM, Jan Stancek wrote:
> This patch introduces wait so that testcases exit doesn't race
> with completion of aio_fsync.
> 
> This is to avoid SIGSEGV:
>  #0  0x000003fffd1f4a24 in _IO_flush_all_lockp () at genops.c:850
>  #1  0x000003fffd1f4b8e in _IO_cleanup () at genops.c:1010
>  #2  0x000003fffd1a88f6 in __run_exit_handlers () at exit.c:90
>  #3  0x000003fffd1a89b0 in __GI_exit () at exit.c:99
>  #4  0x000003fffd18c822 in __libc_start_main () at libc-start.c:292
>  #5  0x0000000080000b76 in _start ()
> 
> Signed-off-by: Jan Stancek <jstancek@redhat.com>

I pushed this, thank you ;)

Wanlong Gao


------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2013-08-21  6:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-12 11:03 [LTP] [PATCH] aio_fsync: wait until aio_fsync completes Jan Stancek
2013-08-12 12:07 ` chrubis
2013-08-20  6:52 ` Wanlong Gao
2013-08-21  6:35 ` Wanlong Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox