aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/cfq-iosched.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index f3799432676d..ae21919f15e1 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]);
@@ -3084,7 +3087,8 @@ cfq_drop_dead_cic(struct cfq_data *cfqd, struct io_context *ioc,
3084 3087
3085 spin_lock_irqsave(&ioc->lock, flags); 3088 spin_lock_irqsave(&ioc->lock, flags);
3086 3089
3087 BUG_ON(ioc->ioc_data == cic); 3090 BUG_ON(rcu_dereference_check(ioc->ioc_data,
3091 lockdep_is_held(&ioc->lock)) == cic);
3088 3092
3089 radix_tree_delete(&ioc->radix_root, cfqd->cic_index); 3093 radix_tree_delete(&ioc->radix_root, cfqd->cic_index);
3090 hlist_del_rcu(&cic->cic_list); 3094 hlist_del_rcu(&cic->cic_list);