diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/cfq-iosched.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index f26da2bfcc15..f4e1006c253d 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -1214,6 +1214,8 @@ static void cfq_exit_cfqq(struct cfq_data *cfqd, struct cfq_queue *cfqq) | |||
1214 | static void __cfq_exit_single_io_context(struct cfq_data *cfqd, | 1214 | static void __cfq_exit_single_io_context(struct cfq_data *cfqd, |
1215 | struct cfq_io_context *cic) | 1215 | struct cfq_io_context *cic) |
1216 | { | 1216 | { |
1217 | struct io_context *ioc = cic->ioc; | ||
1218 | |||
1217 | list_del_init(&cic->queue_list); | 1219 | list_del_init(&cic->queue_list); |
1218 | 1220 | ||
1219 | /* | 1221 | /* |
@@ -1223,6 +1225,9 @@ static void __cfq_exit_single_io_context(struct cfq_data *cfqd, | |||
1223 | cic->dead_key = (unsigned long) cic->key; | 1225 | cic->dead_key = (unsigned long) cic->key; |
1224 | cic->key = NULL; | 1226 | cic->key = NULL; |
1225 | 1227 | ||
1228 | if (ioc->ioc_data == cic) | ||
1229 | rcu_assign_pointer(ioc->ioc_data, NULL); | ||
1230 | |||
1226 | if (cic->cfqq[ASYNC]) { | 1231 | if (cic->cfqq[ASYNC]) { |
1227 | cfq_exit_cfqq(cfqd, cic->cfqq[ASYNC]); | 1232 | cfq_exit_cfqq(cfqd, cic->cfqq[ASYNC]); |
1228 | cic->cfqq[ASYNC] = NULL; | 1233 | cic->cfqq[ASYNC] = NULL; |
@@ -1255,7 +1260,6 @@ static void cfq_exit_single_io_context(struct io_context *ioc, | |||
1255 | */ | 1260 | */ |
1256 | static void cfq_exit_io_context(struct io_context *ioc) | 1261 | static void cfq_exit_io_context(struct io_context *ioc) |
1257 | { | 1262 | { |
1258 | rcu_assign_pointer(ioc->ioc_data, NULL); | ||
1259 | call_for_each_cic(ioc, cfq_exit_single_io_context); | 1263 | call_for_each_cic(ioc, cfq_exit_single_io_context); |
1260 | } | 1264 | } |
1261 | 1265 | ||
@@ -1478,8 +1482,7 @@ cfq_drop_dead_cic(struct cfq_data *cfqd, struct io_context *ioc, | |||
1478 | 1482 | ||
1479 | spin_lock_irqsave(&ioc->lock, flags); | 1483 | spin_lock_irqsave(&ioc->lock, flags); |
1480 | 1484 | ||
1481 | if (ioc->ioc_data == cic) | 1485 | BUG_ON(ioc->ioc_data == cic); |
1482 | rcu_assign_pointer(ioc->ioc_data, NULL); | ||
1483 | 1486 | ||
1484 | radix_tree_delete(&ioc->radix_root, (unsigned long) cfqd); | 1487 | radix_tree_delete(&ioc->radix_root, (unsigned long) cfqd); |
1485 | hlist_del_rcu(&cic->cic_list); | 1488 | hlist_del_rcu(&cic->cic_list); |