diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/cfq-iosched.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index f3799432676d..fd566c1e2617 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -2773,11 +2773,14 @@ static void __cfq_exit_single_io_context(struct cfq_data *cfqd, | |||
2773 | smp_wmb(); | 2773 | smp_wmb(); |
2774 | cic->key = cfqd_dead_key(cfqd); | 2774 | cic->key = cfqd_dead_key(cfqd); |
2775 | 2775 | ||
2776 | rcu_read_lock(); | ||
2776 | if (rcu_dereference(ioc->ioc_data) == cic) { | 2777 | if (rcu_dereference(ioc->ioc_data) == cic) { |
2778 | rcu_read_unlock(); | ||
2777 | spin_lock(&ioc->lock); | 2779 | spin_lock(&ioc->lock); |
2778 | rcu_assign_pointer(ioc->ioc_data, NULL); | 2780 | rcu_assign_pointer(ioc->ioc_data, NULL); |
2779 | spin_unlock(&ioc->lock); | 2781 | spin_unlock(&ioc->lock); |
2780 | } | 2782 | } else |
2783 | rcu_read_unlock(); | ||
2781 | 2784 | ||
2782 | if (cic->cfqq[BLK_RW_ASYNC]) { | 2785 | if (cic->cfqq[BLK_RW_ASYNC]) { |
2783 | cfq_exit_cfqq(cfqd, cic->cfqq[BLK_RW_ASYNC]); | 2786 | cfq_exit_cfqq(cfqd, cic->cfqq[BLK_RW_ASYNC]); |