Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8bdd3f8a6993fef2f364aca6e1a59559405773a2
Commit:     8bdd3f8a6993fef2f364aca6e1a59559405773a2
Parent:     4f4f6c2502474f51654a699d7127d86c2f87075a
Author:     Jens Axboe <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 1 09:44:28 2008 +0100
Committer:  Jens Axboe <[EMAIL PROTECTED]>
CommitDate: Fri Feb 1 09:44:28 2008 +0100

    as-iosched: fix inconsistent ioc->lock context
    
    Since it's acquired from irq context, all locking must be of the
    irq safe variant. Most are already inside the queue lock (which
    already disables interrupts), but the io scheduler rmmod path
    always has irqs enabled and the put_io_context() path may legally
    be called with irqs enabled (even if it isn't usually). So fixup
    those two.
    
    Signed-off-by: Jens Axboe <[EMAIL PROTECTED]>
---
 block/as-iosched.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/block/as-iosched.c b/block/as-iosched.c
index 9603684..612d640 100644
--- a/block/as-iosched.c
+++ b/block/as-iosched.c
@@ -170,11 +170,11 @@ static void free_as_io_context(struct as_io_context *aic)
 
 static void as_trim(struct io_context *ioc)
 {
-       spin_lock(&ioc->lock);
+       spin_lock_irq(&ioc->lock);
        if (ioc->aic)
                free_as_io_context(ioc->aic);
        ioc->aic = NULL;
-       spin_unlock(&ioc->lock);
+       spin_unlock_irq(&ioc->lock);
 }
 
 /* Called when the task exits */
@@ -235,10 +235,12 @@ static void as_put_io_context(struct request *rq)
        aic = RQ_IOC(rq)->aic;
 
        if (rq_is_sync(rq) && aic) {
-               spin_lock(&aic->lock);
+               unsigned long flags;
+
+               spin_lock_irqsave(&aic->lock, flags);
                set_bit(AS_TASK_IORUNNING, &aic->state);
                aic->last_end_request = jiffies;
-               spin_unlock(&aic->lock);
+               spin_unlock_irqrestore(&aic->lock, flags);
        }
 
        put_io_context(RQ_IOC(rq));
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to