]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
percpu: perform tlb flush after pcpu_map_pages() failure
authorTejun Heo <tj@kernel.org>
Fri, 15 Aug 2014 20:06:10 +0000 (16:06 -0400)
committerZefan Li <lizefan@huawei.com>
Mon, 1 Dec 2014 10:02:23 +0000 (18:02 +0800)
commit 849f5169097e1ba35b90ac9df76b5bb6f9c0aabd upstream.

If pcpu_map_pages() fails midway, it unmaps the already mapped pages.
Currently, it doesn't flush tlb after the partial unmapping.  This may
be okay in most cases as the established mapping hasn't been used at
that point but it can go wrong and when it goes wrong it'd be
extremely difficult to track down.

Flush tlb after the partial unmapping.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Zefan Li <lizefan@huawei.com>
mm/percpu-vm.c

index 6c055e4f35f2e0448b5c603db8c774dc3489c282..6f3db37070246783fa95db83b8d96f64d8555a0b 100644 (file)
@@ -272,6 +272,7 @@ err:
                __pcpu_unmap_pages(pcpu_chunk_addr(chunk, tcpu, page_start),
                                   page_end - page_start);
        }
+       pcpu_post_unmap_tlb_flush(chunk, page_start, page_end);
        return err;
 }