|
@@ -599,9 +599,6 @@ static void use_mm(struct mm_struct *mm)
|
|
* by the calling kernel thread
|
|
* by the calling kernel thread
|
|
* (Note: this routine is intended to be called only
|
|
* (Note: this routine is intended to be called only
|
|
* from a kernel thread context)
|
|
* from a kernel thread context)
|
|
- *
|
|
|
|
- * Comments: Called with ctx->ctx_lock held. This nests
|
|
|
|
- * task_lock instead ctx_lock.
|
|
|
|
*/
|
|
*/
|
|
static void unuse_mm(struct mm_struct *mm)
|
|
static void unuse_mm(struct mm_struct *mm)
|
|
{
|
|
{
|
|
@@ -850,14 +847,16 @@ static void aio_kick_handler(struct work_struct *work)
|
|
{
|
|
{
|
|
struct kioctx *ctx = container_of(work, struct kioctx, wq.work);
|
|
struct kioctx *ctx = container_of(work, struct kioctx, wq.work);
|
|
mm_segment_t oldfs = get_fs();
|
|
mm_segment_t oldfs = get_fs();
|
|
|
|
+ struct mm_struct *mm;
|
|
int requeue;
|
|
int requeue;
|
|
|
|
|
|
set_fs(USER_DS);
|
|
set_fs(USER_DS);
|
|
use_mm(ctx->mm);
|
|
use_mm(ctx->mm);
|
|
spin_lock_irq(&ctx->ctx_lock);
|
|
spin_lock_irq(&ctx->ctx_lock);
|
|
requeue =__aio_run_iocbs(ctx);
|
|
requeue =__aio_run_iocbs(ctx);
|
|
- unuse_mm(ctx->mm);
|
|
|
|
|
|
+ mm = ctx->mm;
|
|
spin_unlock_irq(&ctx->ctx_lock);
|
|
spin_unlock_irq(&ctx->ctx_lock);
|
|
|
|
+ unuse_mm(mm);
|
|
set_fs(oldfs);
|
|
set_fs(oldfs);
|
|
/*
|
|
/*
|
|
* we're in a worker thread already, don't use queue_delayed_work,
|
|
* we're in a worker thread already, don't use queue_delayed_work,
|