Skip to content

Commit 6c57c2c

Browse files
jeffmahoneyLinus Torvalds
authored andcommitted
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: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent d4c3d19 commit 6c57c2c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/reiserfs/resize.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ int reiserfs_resize(struct super_block *s, unsigned long block_count_new)
119119
return -ENOMEM;
120120
}
121121
memset(bitmap, 0,
122-
sizeof(struct reiserfs_bitmap_info) * SB_BMAP_NR(s));
122+
sizeof(struct reiserfs_bitmap_info) * bmap_nr_new);
123123
for (i = 0; i < bmap_nr; i++)
124124
bitmap[i] = old_bitmap[i];
125125

0 commit comments

Comments
 (0)