aboutsummaryrefslogtreecommitdiffstats
path: root/block/cfq-iosched.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r--block/cfq-iosched.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index ee8a90c7c46c..e8525fa72823 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1314,7 +1314,15 @@ static void cfq_exit_single_io_context(struct io_context *ioc,
1314 unsigned long flags; 1314 unsigned long flags;
1315 1315
1316 spin_lock_irqsave(q->queue_lock, flags); 1316 spin_lock_irqsave(q->queue_lock, flags);
1317 __cfq_exit_single_io_context(cfqd, cic); 1317
1318 /*
1319 * Ensure we get a fresh copy of the ->key to prevent
1320 * race between exiting task and queue
1321 */
1322 smp_read_barrier_depends();
1323 if (cic->key)
1324 __cfq_exit_single_io_context(cfqd, cic);
1325
1318 spin_unlock_irqrestore(q->queue_lock, flags); 1326 spin_unlock_irqrestore(q->queue_lock, flags);
1319 } 1327 }
1320} 1328}