|
@@ -2767,8 +2767,11 @@ static void __cfq_exit_single_io_context(struct cfq_data *cfqd,
|
|
smp_wmb();
|
|
smp_wmb();
|
|
cic->key = cfqd_dead_key(cfqd);
|
|
cic->key = cfqd_dead_key(cfqd);
|
|
|
|
|
|
- if (ioc->ioc_data == cic)
|
|
|
|
|
|
+ if (rcu_dereference(ioc->ioc_data) == cic) {
|
|
|
|
+ spin_lock(&ioc->lock);
|
|
rcu_assign_pointer(ioc->ioc_data, NULL);
|
|
rcu_assign_pointer(ioc->ioc_data, NULL);
|
|
|
|
+ spin_unlock(&ioc->lock);
|
|
|
|
+ }
|
|
|
|
|
|
if (cic->cfqq[BLK_RW_ASYNC]) {
|
|
if (cic->cfqq[BLK_RW_ASYNC]) {
|
|
cfq_exit_cfqq(cfqd, cic->cfqq[BLK_RW_ASYNC]);
|
|
cfq_exit_cfqq(cfqd, cic->cfqq[BLK_RW_ASYNC]);
|