diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index f26da2b..4611c84 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -1501,8 +1501,11 @@ cfq_cic_lookup(struct cfq_data *cfqd, struct io_context *ioc) * we maintain a last-hit cache, to avoid browsing over the tree */ cic = rcu_dereference(ioc->ioc_data); - if (cic && cic->key == cfqd) + if (cic && cic->key == cfqd) { + /* check if cic belongs to ioc */ + BUG_ON(cic->ioc != ioc); return cic; + } do { rcu_read_lock();