]> www.infradead.org Git - users/hch/xfstests-dev.git/commit
xfsqa: Fix signal usage in aio-dio test code
authorDave Chinner <david@fromorbit.com>
Tue, 19 Jan 2010 23:28:24 +0000 (10:28 +1100)
committerDave Chinner <david@fromorbit.com>
Tue, 19 Jan 2010 23:28:24 +0000 (10:28 +1100)
commit484590872abfa604bb3e9a40699d85b14c9ad5bc
treef70a14fe379f285fb2adc330cf5545e53f54916f
parent299ed9790bb48a28f2d005dfc27767fc6848b8f2
xfsqa: Fix signal usage in aio-dio test code

Using signal() to set up signal handlers doesn't always do what you
want. A recent upgrade made test 208 fail because wait() was not
getting interrupted by a SIGALRM. Tracing showed that signal() was
being converted to a sigaction(SA_RESTART) handler, which allows
syscalls that return ERESTARTSYS to immediately restart without
returning EINTR to the calling process. The kernel code returns
ERESTARTSYS to signal interruptions while in wait().

Replace the use of signal with sigaction() to ensure that the
SA_RESTART flag is not set and the EINTR is delivered to the process
sitting in wait().  This makes test 208 terminate at 200s again.

Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
src/aio-dio-regress/aio-dio-invalidate-failure.c