aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
authorJason Lunz <lunz@falooley.org>2007-03-29 04:20:31 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-29 11:22:24 -0400
commitaf84eab208916acad91f6342bbd57bc865caf150 (patch)
tree6c652d6f31e1eeaded81cc6a987da00ea203b78a /arch/um
parent3076212f8d3d9fe4d7b11c6b560c0f424edfcb4e (diff)
[PATCH] uml: fix LVM crash
Permit lvm to create logical volumes without crashing UML. When device-mapper's DM_DEV_CREATE_CMD ioctl is called to create a new device, dev_create()->dm_create()->alloc_dev()-> blk_queue_bounce_limit(md->queue, BLK_BOUNCE_ANY) is called. blk_queue_bounce_limit(BLK_BOUNCE_ANY) calls init_emergency_isa_pool() if blk_max_pfn < blk_max_low_pfn. This is the case on UML, but init_emergency_isa_pool() hits BUG_ON(!isa_page_pool) because there doesn't seem to be a dma zone on UML for mempool_create() to allocate from. Most architectures seem to have max_low_pfn == max_pfn, but UML doesn't because of the uml_reserved chunk it keeps for itself. From what I can see, max_pfn and max_low_pfn don't get much use after the bootmem-allocator stops being used anyway, except that they initialize the block layer's blk_max_low_pfn/blk_max_pfn. This ensures init_emergency_isa_pool() doesn't crash uml in this situation by setting max_low_pfn == max_pfn in mem_init(). Signed-off-by: Jason Lunz <lunz@falooley.org> Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Alasdair G Kergon <agk@redhat.com> Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/kernel/mem.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
index e85d65deea0..df7d662b98c 100644
--- a/arch/um/kernel/mem.c
+++ b/arch/um/kernel/mem.c
@@ -64,8 +64,6 @@ static void setup_highmem(unsigned long highmem_start,
64 64
65void mem_init(void) 65void mem_init(void)
66{ 66{
67 max_low_pfn = (high_physmem - uml_physmem) >> PAGE_SHIFT;
68
69 /* clear the zero-page */ 67 /* clear the zero-page */
70 memset((void *) empty_zero_page, 0, PAGE_SIZE); 68 memset((void *) empty_zero_page, 0, PAGE_SIZE);
71 69
@@ -80,6 +78,7 @@ void mem_init(void)
80 78
81 /* this will put all low memory onto the freelists */ 79 /* this will put all low memory onto the freelists */
82 totalram_pages = free_all_bootmem(); 80 totalram_pages = free_all_bootmem();
81 max_low_pfn = totalram_pages;
83#ifdef CONFIG_HIGHMEM 82#ifdef CONFIG_HIGHMEM
84 totalhigh_pages = highmem >> PAGE_SHIFT; 83 totalhigh_pages = highmem >> PAGE_SHIFT;
85 totalram_pages += totalhigh_pages; 84 totalram_pages += totalhigh_pages;