From 6b320344c00c02a6ccfc9339cc9b18a93c1f7773 Mon Sep 17 00:00:00 2001 From: Paolo Valente Date: Fri, 6 Aug 2010 08:03:01 +0200 Subject: [PATCH] bfq-iosched: fix error in get_bfqd_locked Signed-off-by: Paolo Valente --- block/bfq.h | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/block/bfq.h b/block/bfq.h index cc95d18..078b416 100644 --- a/block/bfq.h +++ b/block/bfq.h @@ -1,5 +1,5 @@ /* - * BFQ: data structures and common functions prototypes. + * BFQ-v1-r1 for 2.6.35: data structures and common functions prototypes. * * Based on ideas and code from CFQ: * Copyright (C) 2003 Jens Axboe @@ -526,14 +526,15 @@ static inline struct bfq_data *bfq_get_bfqd_locked(void **ptr, rcu_read_lock(); bfqd = rcu_dereference(*(struct bfq_data **)ptr); - if (bfqd != NULL) { + + if (bfqd != NULL && ! ((unsigned long) bfqd & CIC_DEAD_KEY)) { spin_lock_irqsave(bfqd->queue->queue_lock, *flags); - if (*ptr == bfqd && ! ((unsigned long) bfqd & CIC_DEAD_KEY)) + if (*ptr == bfqd) goto out; spin_unlock_irqrestore(bfqd->queue->queue_lock, *flags); - bfqd = NULL; } + bfqd = NULL; out: rcu_read_unlock(); return bfqd; -- 1.7.0.4