aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/mballoc.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2009-01-05 21:48:56 -0500
committerTheodore Ts'o <tytso@mit.edu>2009-01-05 21:48:56 -0500
commit29eaf024980e07cc01f31ae4ea5d68c917f4b7da (patch)
tree969f94ad36afc5e1edcd51964f0c6bc5b0044371 /fs/ext4/mballoc.c
parent8556e8f3b6c4c11601ce1e9ea8090a6d8bd5daae (diff)
ext4: Init the complete page while building buddy cache
We need to init the complete page during buddy cache init by setting the contents to '1'. Otherwise we can see the following errors after doing an online resize of the filesystem: EXT4-fs error (device sdb1): ext4_mb_mark_diskspace_used: Allocating block 1040385 in system zone of 127 group Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Cc: stable@kernel.org
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r--fs/ext4/mballoc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 0c7e247f714c..fd2294de404c 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -846,6 +846,8 @@ static int ext4_mb_init_cache(struct page *page, char *incore)
846 846
847 err = 0; 847 err = 0;
848 first_block = page->index * blocks_per_page; 848 first_block = page->index * blocks_per_page;
849 /* init the page */
850 memset(page_address(page), 0xff, PAGE_CACHE_SIZE);
849 for (i = 0; i < blocks_per_page; i++) { 851 for (i = 0; i < blocks_per_page; i++) {
850 int group; 852 int group;
851 struct ext4_group_info *grinfo; 853 struct ext4_group_info *grinfo;
@@ -872,7 +874,6 @@ static int ext4_mb_init_cache(struct page *page, char *incore)
872 BUG_ON(incore == NULL); 874 BUG_ON(incore == NULL);
873 mb_debug("put buddy for group %u in page %lu/%x\n", 875 mb_debug("put buddy for group %u in page %lu/%x\n",
874 group, page->index, i * blocksize); 876 group, page->index, i * blocksize);
875 memset(data, 0xff, blocksize);
876 grinfo = ext4_get_group_info(sb, group); 877 grinfo = ext4_get_group_info(sb, group);
877 grinfo->bb_fragments = 0; 878 grinfo->bb_fragments = 0;
878 memset(grinfo->bb_counters, 0, 879 memset(grinfo->bb_counters, 0,