summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4f4f6c2)
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 <jens.axboe@oracle.com>
static void as_trim(struct io_context *ioc)
{
static void as_trim(struct io_context *ioc)
{
+ spin_lock_irq(&ioc->lock);
if (ioc->aic)
free_as_io_context(ioc->aic);
ioc->aic = NULL;
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 */
}
/* Called when the task exits */
aic = RQ_IOC(rq)->aic;
if (rq_is_sync(rq) && aic) {
aic = RQ_IOC(rq)->aic;
if (rq_is_sync(rq) && aic) {
+ unsigned long flags;
+
+ spin_lock_irqsave(&aic->lock, flags);
set_bit(AS_TASK_IORUNNING, &aic->state);
aic->last_end_request = jiffies;
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));
}
put_io_context(RQ_IOC(rq));