diff options
| author | Dan Williams <dan.j.williams@intel.com> | 2017-08-31 16:25:59 -0700 |
|---|---|---|
| committer | Dan Williams <dan.j.williams@intel.com> | 2017-08-31 16:25:59 -0700 |
| commit | 8f98ae0c9b90bb46097e4f28e81e9ae6148e5694 (patch) | |
| tree | c1d0f0d9b0733bf3271780e45d7a1c299fe2fc48 /mm/page_io.c | |
| parent | 58738c495e15badd2015e19ff41f1f1ed55200bc (diff) | |
| parent | 5e405595e5bf4c09fab9ca1e7dbe5b62872757b5 (diff) | |
Merge branch 'for-4.14/fs' into libnvdimm-for-next
Diffstat (limited to 'mm/page_io.c')
| -rw-r--r-- | mm/page_io.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mm/page_io.c b/mm/page_io.c index b6c4ac388209..5f61b54ee1f3 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -22,6 +22,7 @@ #include <linux/frontswap.h> #include <linux/blkdev.h> #include <linux/uio.h> +#include <linux/sched/task.h> #include <asm/pgtable.h> static struct bio *get_swap_bio(gfp_t gfp_flags, @@ -136,6 +137,7 @@ out: WRITE_ONCE(bio->bi_private, NULL); bio_put(bio); wake_up_process(waiter); + put_task_struct(waiter); } int generic_swapfile_activate(struct swap_info_struct *sis, @@ -378,6 +380,11 @@ int swap_readpage(struct page *page, bool do_poll) goto out; } bdev = bio->bi_bdev; + /* + * Keep this task valid during swap readpage because the oom killer may + * attempt to access it in the page fault retry time check. + */ + get_task_struct(current); bio->bi_private = current; bio_set_op_attrs(bio, REQ_OP_READ, 0); count_vm_event(PSWPIN); |
