All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v2] dio_sparse: prevent race between kill and signal
@ 2012-06-06 12:28 Jan Stancek
  2012-06-06 13:56 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Stancek @ 2012-06-06 12:28 UTC (permalink / raw)
  To: ltp-list

[-- Attachment #1: Type: text/plain, Size: 452 bytes --]


This is same change as in:
  commit d8f1292181b486b2073cc6fe1ec226f5cedea342
  Author: Cyril Hrubis <chrubis@suse.cz>
  Date:   Fri Mar 2 13:37:47 2012 +0100
      ltp-aiodio: aiodio_sparse fix race condition

but for dio_sparse.c, which is also prone to race
between kill() and signal().

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 testcases/kernel/io/ltp-aiodio/dio_sparse.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)



[-- Attachment #2: 0001-dio_sparse-prevent-race-between-kill-and-signal.patch --]
[-- Type: text/x-patch, Size: 739 bytes --]

diff --git a/testcases/kernel/io/ltp-aiodio/dio_sparse.c b/testcases/kernel/io/ltp-aiodio/dio_sparse.c
index e93dcd9..97dbef8 100644
--- a/testcases/kernel/io/ltp-aiodio/dio_sparse.c
+++ b/testcases/kernel/io/ltp-aiodio/dio_sparse.c
@@ -149,10 +149,10 @@ int main(int argc, char **argv)
 	dirty_freeblocks(filesize);
 
 	tst_resm(TINFO, "Starting I/O tests");
+	signal(SIGTERM, SIG_DFL);
 	for (i = 0; i < num_children; i++) {
 		switch (pid[i] = fork()) {
 		case 0:
-			signal(SIGTERM, SIG_DFL);
 			read_sparse(filename, filesize);
 		break;
 		case -1:
@@ -164,6 +164,7 @@ int main(int argc, char **argv)
 			continue;
 		}
 	}
+	tst_sig(FORK, DEF_HANDLER, cleanup);
 	
 	ret = dio_sparse(filename, alignment, writesize, filesize);
 


[-- Attachment #3: Type: text/plain, Size: 395 bytes --]

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2012-06-06 13:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-06 12:28 [LTP] [PATCH v2] dio_sparse: prevent race between kill and signal Jan Stancek
2012-06-06 13:56 ` Cyril Hrubis

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.