Patch from Anders Gustafsson We're getting a division-by-zero in the writeback code during early rootfs population, because writeback has not yet been initialised. Fix that by performing an explicit initialisation rather than relying on initcall ordering. include/linux/writeback.h | 1 + init/main.c | 3 +++ mm/page-writeback.c | 4 +--- 3 files changed, 5 insertions(+), 3 deletions(-) diff -puN include/linux/writeback.h~early-writeback-init include/linux/writeback.h --- 25/include/linux/writeback.h~early-writeback-init 2003-03-12 02:43:28.000000000 -0800 +++ 25-akpm/include/linux/writeback.h 2003-03-12 02:43:28.000000000 -0800 @@ -79,6 +79,7 @@ extern int dirty_writeback_centisecs; extern int dirty_expire_centisecs; +void page_writeback_init(void); void balance_dirty_pages(struct address_space *mapping); void balance_dirty_pages_ratelimited(struct address_space *mapping); int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0); diff -puN init/main.c~early-writeback-init init/main.c --- 25/init/main.c~early-writeback-init 2003-03-12 02:43:28.000000000 -0800 +++ 25-akpm/init/main.c 2003-03-12 02:43:28.000000000 -0800 @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -433,6 +434,8 @@ asmlinkage void __init start_kernel(void vfs_caches_init(num_physpages); radix_tree_init(); signals_init(); + /* rootfs populating might need page-writeback */ + page_writeback_init(); populate_rootfs(); #ifdef CONFIG_PROC_FS proc_root_init(); diff -puN mm/page-writeback.c~early-writeback-init mm/page-writeback.c --- 25/mm/page-writeback.c~early-writeback-init 2003-03-12 02:43:28.000000000 -0800 +++ 25-akpm/mm/page-writeback.c 2003-03-12 02:43:28.000000000 -0800 @@ -369,7 +369,7 @@ static struct notifier_block ratelimit_n * dirty memory thresholds: allowing too much dirty highmem pins an excessive * number of buffer_heads. */ -static int __init page_writeback_init(void) +void __init page_writeback_init(void) { long buffer_pages = nr_free_buffer_pages(); long correction; @@ -392,9 +392,7 @@ static int __init page_writeback_init(vo add_timer(&wb_timer); set_ratelimit(); register_cpu_notifier(&ratelimit_nb); - return 0; } -module_init(page_writeback_init); int do_writepages(struct address_space *mapping, struct writeback_control *wbc) { _