From 6c57c2c8d3862c8d5b908669654f6565da74ec19 Mon Sep 17 00:00:00 2001 From: Jeff Mahoney Date: Thu, 18 Oct 2007 23:39:25 -0700 Subject: [PATCH] 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/reiserfs/resize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/reiserfs/resize.c b/fs/reiserfs/resize.c index 976cc7887a0d..3bec2f96242a 100644 --- a/fs/reiserfs/resize.c +++ b/fs/reiserfs/resize.c @@ -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]; -- 2.20.1