]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
reiserfs: fix memset byte count during resize
authorJeff Mahoney <jeffm@suse.com>
Fri, 19 Oct 2007 06:39:25 +0000 (23:39 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 19 Oct 2007 18:53:35 +0000 (11:53 -0700)
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>
fs/reiserfs/resize.c

index 976cc7887a0dfe60c4f5933e7d7757acfb6cf8bf..3bec2f96242a76a31882dee9504b96d8c5731727 100644 (file)
@@ -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];