Jeff Moyer 65c24491b4 aio: lookup_ioctx can return the wrong value when looking up a bogus context
The libaio test harness turned up a problem whereby lookup_ioctx on a
bogus io context was returning the 1 valid io context from the list
(harness/cases/3.p).

Because of that, an extra put_iocontext was done, and when the process
exited, it hit a BUG_ON in the put_iocontext macro called from exit_aio
(since we expect a users count of 1 and instead get 0).

The problem was introduced by "aio: make the lookup_ioctx() lockless"
(commit abf137dd7712132ee56d5b3143c2ff61a72a5faa).

Thanks to Zach for pointing out that hlist_for_each_entry_rcu will not
return with a NULL tpos at the end of the loop, even if the entry was
not found.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Acked-by: Zach Brown <zach.brown@oracle.com>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Cc: Benjamin LaHaise <bcrl@kvack.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-03-19 15:57:18 -07:00
..
2009-01-22 13:16:01 +03:00
2009-01-22 13:15:56 +03:00
2009-01-22 13:15:56 +03:00
2009-01-22 13:16:01 +03:00
2009-01-22 13:15:57 +03:00
2009-01-22 13:15:57 +03:00
2009-01-22 13:16:01 +03:00
2009-01-22 13:15:58 +03:00
2009-03-10 15:55:11 -07:00
2009-01-22 13:15:57 +03:00
2009-03-11 12:04:18 -07:00
2009-01-22 13:15:58 +03:00
2009-01-22 13:15:57 +03:00
2009-01-22 13:15:57 +03:00
2009-01-22 13:15:59 +03:00
2008-11-14 10:39:25 +11:00
2009-01-22 13:15:55 +03:00
2009-01-22 13:15:54 +03:00
2009-01-22 13:15:58 +03:00
2008-10-17 02:38:36 +11:00
2009-01-22 13:15:55 +03:00
2009-01-22 13:15:58 +03:00
2009-01-22 13:15:59 +03:00
2009-01-22 13:15:53 +03:00
2009-01-22 13:15:59 +03:00
2009-01-22 13:16:01 +03:00
2009-01-22 13:15:59 +03:00
2009-01-29 16:34:30 +02:00
2009-01-22 13:15:55 +03:00
2009-01-22 13:16:00 +03:00
2008-12-31 18:07:43 -05:00
2009-01-03 11:45:54 -08:00
2009-02-06 17:34:07 -08:00
2009-03-14 21:06:52 +01:00
2009-02-07 08:46:18 +11:00
2009-01-16 18:02:10 +01:00
2009-02-07 08:46:18 +11:00
2009-03-12 16:20:24 -07:00
2009-02-07 08:46:18 +11:00
2009-01-22 13:16:01 +03:00
2009-02-17 14:02:08 -08:00
2009-02-18 15:37:53 -08:00
2009-03-12 16:20:23 -07:00
2009-02-18 15:37:53 -08:00