[patch 5/7] reiserfs: fix memset byte count during resize

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 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.

Signed-off-by: Jeff Mahoney <jeffm@xxxxxxxx>
---
 fs/reiserfs/resize.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/reiserfs/resize.c	2007-10-16 18:52:23.281225507 -0400
+++ b/fs/reiserfs/resize.c	2007-10-16 18:55:56.641755755 -0400
@@ -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];
 

-- 

-
To unsubscribe from this list: send the line "unsubscribe reiserfs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux File System Development]     [Linux BTRFS]     [Linux NFS]     [Linux Filesystems]     [Ext4 Filesystem]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Resources]

  Powered by Linux