Skip to content

Commit

Permalink
reiserfs: fix memset byte count during resize
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff Mahoney authored and Linus Torvalds committed Oct 19, 2007
1 parent d4c3d19 commit 6c57c2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/reiserfs/resize.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down

0 comments on commit 6c57c2c

Please sign in to comment.