Nick Piggin 3bd9a5d734 aio: fix rcu ioctx lookup
aio-dio-invalidate-failure GPFs in aio_put_req from io_submit.

lookup_ioctx doesn't implement the rcu lookup pattern properly.
rcu_read_lock does not prevent refcount going to zero, so we might take
a refcount on a zero count ioctx.

Fix the bug by atomically testing for zero refcount before incrementing.

[jack@suse.cz: added comment into the code]
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-02-25 15:07:37 -08:00
..
2011-01-12 20:03:43 -05:00
2011-01-12 20:02:45 -05:00
2011-01-12 20:03:42 -05:00
2011-02-25 11:12:37 -08:00
2011-01-07 17:50:26 +11:00
2011-02-21 22:31:47 +00:00
2010-10-29 04:16:28 -04:00
2010-10-29 04:16:28 -04:00
2011-02-11 16:50:47 -06:00
2011-01-07 17:50:26 +11:00
2011-01-07 17:50:26 +11:00
2011-01-14 09:23:36 -08:00
2011-01-12 20:02:44 -05:00
2011-01-12 20:02:45 -05:00
2011-01-12 20:03:42 -05:00
2011-01-07 17:50:26 +11:00
2011-01-07 17:50:26 +11:00
2011-01-12 20:02:43 -05:00
2011-01-12 20:02:44 -05:00
2011-01-28 13:41:35 -05:00
2010-10-29 04:16:13 -04:00
2011-01-07 17:50:26 +11:00
2011-02-15 07:34:16 -08:00
2011-01-07 17:50:26 +11:00
2010-10-29 04:16:31 -04:00
2011-01-07 17:50:26 +11:00
2011-01-12 20:02:44 -05:00
2011-01-07 17:50:26 +11:00
2011-01-07 17:50:26 +11:00
2011-02-25 15:07:37 -08:00
2011-01-13 08:03:12 -08:00
2010-10-29 04:16:28 -04:00
2011-02-02 16:03:19 -08:00
2011-02-02 16:03:19 -08:00
2010-10-15 15:53:27 +02:00
2011-01-07 17:50:27 +11:00
2010-10-28 09:44:56 -07:00
2011-01-13 17:32:32 -08:00
2011-02-16 08:56:55 -08:00
2011-02-24 02:10:57 -05:00
2011-01-07 17:50:33 +11:00
2010-08-09 16:48:44 -04:00
2010-08-09 16:47:43 -04:00