Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285122
b: refs/heads/master
c: fd63836
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed Dec 25, 2011
1 parent 88709ef commit f7c9366
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 64c42998f14d5894ea3138625897d620b30c8e4e
refs/heads/master: fd63836811d6e5b5f5f608abf865bc9e91762c8c
11 changes: 9 additions & 2 deletions trunk/block/blk-ioc.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,16 @@ void create_io_context_slowpath(struct task_struct *task, gfp_t gfp_flags,
INIT_HLIST_HEAD(&ioc->icq_list);
INIT_WORK(&ioc->release_work, ioc_release_fn);

/* try to install, somebody might already have beaten us to it */
/*
* Try to install. ioc shouldn't be installed if someone else
* already did or @task, which isn't %current, is exiting. Note
* that we need to allow ioc creation on exiting %current as exit
* path may issue IOs from e.g. exit_files(). The exit path is
* responsible for not issuing IO after exit_io_context().
*/
task_lock(task);
if (!task->io_context && !(task->flags & PF_EXITING))
if (!task->io_context &&
(task == current || !(task->flags & PF_EXITING)))
task->io_context = ioc;
else
kmem_cache_free(iocontext_cachep, ioc);
Expand Down

0 comments on commit f7c9366

Please sign in to comment.