Skip to contentSkip to conversation

write_bitmaps(): blk_t -> blk64_t

PATCH In review Nick Dokos 2 participants 2 messages May 1, 2009 – May 4, 2009

lore
Share & tools
lore

Nick Dokos

author
#0 lore raw

PATCH 2/6 write_bitmaps(): blk_t -> blk64_t

write_bitmaps() was truncating blocks numbers to 32 bits and therefore writing at the wrong place on the disk.

---
 lib/ext2fs/rw_bitmaps.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
lib/ext2fs/rw_bitmaps.c +2 -2
index 5b504bf..da472a8 100644
@@ -36,8 +36,8 @@ static errcode_t write_bitmaps(ext2_filsys fs, int do_inode, int do_block)
 	errcode_t	retval;
 	char 		*block_buf, *inode_buf;
 	int		csum_flag = 0;
-	blk_t		blk;
-	blk_t		blk_itr = fs->super->s_first_data_block;
+	blk64_t		blk;
+	blk64_t		blk_itr = fs->super->s_first_data_block;
 	ext2_ino_t	ino_itr = 1;
 
 	EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
Signature · 1 line
1.6.0.6
#1 lore raw
Quoted 26 lines · Nick Dokos

write_bitmaps() was truncating blocks numbers to 32 bits and therefore writing at the wrong place on the disk.

---
 lib/ext2fs/rw_bitmaps.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
lib/ext2fs/rw_bitmaps.c +2 -2
index 5b504bf..da472a8 100644
@@ -36,8 +36,8 @@ static errcode_t write_bitmaps(ext2_filsys fs, int do_inode, int do_block)
 	errcode_t	retval;
 	char 		*block_buf, *inode_buf;
 	int		csum_flag = 0;
-	blk_t		blk;
-	blk_t		blk_itr = fs->super->s_first_data_block;
+	blk64_t		blk;
+	blk64_t		blk_itr = fs->super->s_first_data_block;
 	ext2_ino_t	ino_itr = 1;
 
 	EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
Signature · 1 line
1.6.0.6

-VAL