diff options
| -rw-r--r-- | fs/aio.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -470,7 +470,7 @@ static int ioctx_add_table(struct kioctx *ctx, struct mm_struct *mm) | |||
| 470 | struct aio_ring *ring; | 470 | struct aio_ring *ring; |
| 471 | 471 | ||
| 472 | spin_lock(&mm->ioctx_lock); | 472 | spin_lock(&mm->ioctx_lock); |
| 473 | table = mm->ioctx_table; | 473 | table = rcu_dereference(mm->ioctx_table); |
| 474 | 474 | ||
| 475 | while (1) { | 475 | while (1) { |
| 476 | if (table) | 476 | if (table) |
| @@ -498,7 +498,7 @@ static int ioctx_add_table(struct kioctx *ctx, struct mm_struct *mm) | |||
| 498 | table->nr = new_nr; | 498 | table->nr = new_nr; |
| 499 | 499 | ||
| 500 | spin_lock(&mm->ioctx_lock); | 500 | spin_lock(&mm->ioctx_lock); |
| 501 | old = mm->ioctx_table; | 501 | old = rcu_dereference(mm->ioctx_table); |
| 502 | 502 | ||
| 503 | if (!old) { | 503 | if (!old) { |
| 504 | rcu_assign_pointer(mm->ioctx_table, table); | 504 | rcu_assign_pointer(mm->ioctx_table, table); |
| @@ -622,7 +622,7 @@ static void kill_ioctx(struct mm_struct *mm, struct kioctx *ctx) | |||
| 622 | struct kioctx_table *table; | 622 | struct kioctx_table *table; |
| 623 | 623 | ||
| 624 | spin_lock(&mm->ioctx_lock); | 624 | spin_lock(&mm->ioctx_lock); |
| 625 | table = mm->ioctx_table; | 625 | table = rcu_dereference(mm->ioctx_table); |
| 626 | 626 | ||
| 627 | WARN_ON(ctx != table->table[ctx->id]); | 627 | WARN_ON(ctx != table->table[ctx->id]); |
| 628 | table->table[ctx->id] = NULL; | 628 | table->table[ctx->id] = NULL; |
