summaryrefslogtreecommitdiffstats
path: root/fs/aio.c
diff options
context:
space:
mode:
authorBenjamin LaHaise <bcrl@kvack.org>2013-08-30 11:12:50 -0400
committerBenjamin LaHaise <bcrl@kvack.org>2013-08-30 11:12:50 -0400
commit77d30b14d24e557f89c41980011d72428514d729 (patch)
treee3a2b59d7c0c56cf21511de871b05dcdd14294cc /fs/aio.c
parent79bd1bcf1ab22ea723da7d5854a9e72a350ecbf8 (diff)
downloadlinux-77d30b14d24e557f89c41980011d72428514d729.tar.gz
linux-77d30b14d24e557f89c41980011d72428514d729.tar.bz2
linux-77d30b14d24e557f89c41980011d72428514d729.zip
aio: fix rcu sparse warnings introduced by ioctx table lookup patch
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>
Diffstat (limited to 'fs/aio.c')
-rw-r--r--fs/aio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/aio.c b/fs/aio.c
index d0defcb0a493..6e267553604c 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -470,7 +470,7 @@ static int ioctx_add_table(struct kioctx *ctx, struct mm_struct *mm)
struct aio_ring *ring;
spin_lock(&mm->ioctx_lock);
- table = mm->ioctx_table;
+ table = rcu_dereference(mm->ioctx_table);
while (1) {
if (table)
@@ -498,7 +498,7 @@ static int ioctx_add_table(struct kioctx *ctx, struct mm_struct *mm)
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);
@@ -622,7 +622,7 @@ static void kill_ioctx(struct mm_struct *mm, struct kioctx *ctx)
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;