提交 6c57c2c8 编写于 作者: J Jeff Mahoney 提交者: Linus Torvalds

reiserfs: fix memset byte count during resize

Correct the memset in reiserfs_resize to clear the memory allocated for the
new bitmap info structs.  Previously, it would clear the memory used by the
old size.  Depending on the contents of memory, this could cause incorrect
caching behavior for bitmap blocks in the newly allocated area.
Signed-off-by: NJeff Mahoney <jeffm@suse.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 d4c3d19d
......@@ -119,7 +119,7 @@ int reiserfs_resize(struct super_block *s, unsigned long block_count_new)
return -ENOMEM;
}
memset(bitmap, 0,
sizeof(struct reiserfs_bitmap_info) * SB_BMAP_NR(s));
sizeof(struct reiserfs_bitmap_info) * bmap_nr_new);
for (i = 0; i < bmap_nr; i++)
bitmap[i] = old_bitmap[i];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册