Skip to contentSkip to conversation

reiserfs: fix memset byte count during resize

PATCH New Jeff Mahoney 1 participant 1 message Aug 7, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 reiserfs: fix memset byte count during resize

The following patch corrects 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.

---
 fs/reiserfs/resize.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/reiserfs/resize.c +1 -1
@@ -119,7 +119,7 @@ int reiserfs_resize(struct super_block *
 			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];
 
Signature · 2 lines
Jeff Mahoney
SUSE Labs