Sseveral sparse warnings were caused by missing rcu_dereference() annotations
for dereferencing mm->ioctx_table. Thankfully, none of those were actual bugs
as the deref was protected by a spin lock in all instances.
Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
struct aio_ring *ring;
spin_lock(&mm->ioctx_lock);
- table = mm->ioctx_table;
+ table = rcu_dereference(mm->ioctx_table);
while (1) {
if (table)
table->nr = new_nr;
spin_lock(&mm->ioctx_lock);
- old = mm->ioctx_table;
+ old = rcu_dereference(mm->ioctx_table);
if (!old) {
rcu_assign_pointer(mm->ioctx_table, table);
struct kioctx_table *table;
spin_lock(&mm->ioctx_lock);
- table = mm->ioctx_table;
+ table = rcu_dereference(mm->ioctx_table);
WARN_ON(ctx != table->table[ctx->id]);
table->table[ctx->id] = NULL;