aio: test closing the fd before destroying the ioctx
authorJeff Moyer <jmoyer@redhat.com>
Wed, 13 Aug 2014 01:00:38 +0000 (11:00 +1000)
committerDave Chinner <david@fromorbit.com>
Wed, 13 Aug 2014 01:00:38 +0000 (11:00 +1000)
commit73bea923f33ca3ed705666677d7f0cd56810e405
tree8361773fd11a559e6bca9f0aaf41805e9276ace8
parent736a5b0d7c874ff199525514a769ef5b86350854
aio: test closing the fd before destroying the ioctx

By closing the file descriptor before calling io_destroy, you pretty
much guarantee that the last put on the ioctx will be done in interrupt
context (during I/O completion).  This behavior has unearthed bugs in
the kernel in several different kernel versions, so let's add a test to
poke at it.

The original test case was provided by Matt Cross.  He has graciously
relicensed it under the GPL v2 or later so that it can be included in
xfstests.  I've modified the test a bit so that it would generate a
stable output format and to run for a fixed amount of time.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
src/aio-dio-regress/aio-last-ref-held-by-io.c [new file with mode: 0644]
tests/generic/323 [new file with mode: 0644]
tests/generic/323.out [new file with mode: 0644]
tests/generic/group